Fix #95105: Unclamp draw size of the frame node's label #104555
No reviewers
Labels
No Label
Interest
Alembic
Interest
Animation & Rigging
Interest
Asset Browser
Interest
Asset Browser Project Overview
Interest
Audio
Interest
Automated Testing
Interest
Blender Asset Bundle
Interest
BlendFile
Interest
Collada
Interest
Compatibility
Interest
Compositing
Interest
Core
Interest
Cycles
Interest
Dependency Graph
Interest
Development Management
Interest
EEVEE
Interest
EEVEE & Viewport
Interest
Freestyle
Interest
Geometry Nodes
Interest
Grease Pencil
Interest
ID Management
Interest
Images & Movies
Interest
Import Export
Interest
Line Art
Interest
Masking
Interest
Metal
Interest
Modeling
Interest
Modifiers
Interest
Motion Tracking
Interest
Nodes & Physics
Interest
OpenGL
Interest
Overlay
Interest
Overrides
Interest
Performance
Interest
Physics
Interest
Pipeline, Assets & IO
Interest
Platforms, Builds & Tests
Interest
Python API
Interest
Render & Cycles
Interest
Render Pipeline
Interest
Sculpt, Paint & Texture
Interest
Text Editor
Interest
Translations
Interest
Triaging
Interest
Undo
Interest
USD
Interest
User Interface
Interest
UV Editing
Interest
VFX & Video
Interest
Video Sequencer
Interest
Virtual Reality
Interest
Vulkan
Interest
Wayland
Interest
Workbench
Interest: X11
Legacy
Blender 2.8 Project
Legacy
Milestone 1: Basic, Local Asset Browser
Legacy
OpenGL Error
Meta
Good First Issue
Meta
Papercut
Meta
Retrospective
Meta
Security
Module
Animation & Rigging
Module
Core
Module
Development Management
Module
EEVEE & Viewport
Module
Grease Pencil
Module
Modeling
Module
Nodes & Physics
Module
Pipeline, Assets & IO
Module
Platforms, Builds & Tests
Module
Python API
Module
Render & Cycles
Module
Sculpt, Paint & Texture
Module
Triaging
Module
User Interface
Module
VFX & Video
Platform
FreeBSD
Platform
Linux
Platform
macOS
Platform
Windows
Priority
High
Priority
Low
Priority
Normal
Priority
Unbreak Now!
Status
Archived
Status
Confirmed
Status
Duplicate
Status
Needs Info from Developers
Status
Needs Information from User
Status
Needs Triage
Status
Resolved
Type
Bug
Type
Design
Type
Known Issue
Type
Patch
Type
Report
Type
To Do
No Milestone
No project
No Assignees
3 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: blender/blender#104555
Loading…
Reference in New Issue
No description provided.
Delete Branch "lone_noel/blender:fix-95105-unclamp-frame-node-label"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Fix issues with the display of frame node labels, that made them
harder to read for people with low vision or on high dpi displays:
so all sizes can be displayed consistently at all zoom levels
and independet of the UI scale.
bounds, so child nodes don't obscure the label.
This patch was originally submitted here:
https://archive.blender.org/developer/D13954
There were some more general ideas about how to change the design
of the frame's label that are worth exploring, but I think the
patch is a good improvement to the behavior of the current design
and worth including as a fix.
Comparison
Notice how (a) the labels of different sizes are now displayed the same
relative to the other elements in the node tree in all zoom levels and
(b) the child nodes don't overlap the labels anymore.
To make it fit with the label, the margin for the text drawn in
the frame node has also been increased.
@ -2684,13 +2684,21 @@ static void count_multi_input_socket_links(bNodeTree &ntree, SpaceNode &snode)
}
}
#define NODE_FRAME_MARGIN (1.5f * U.widget_unit)
Are it make sense to move it on top file part?
I don't really have a preference, but some of the other #define's (e.g.
NODE_HEADER_ICON_SIZE
) are also declared right before the section they are used in, so I think it makes sense to stay consistent with that for now.@ -2694,0 +2698,4 @@
/* This is a reasonable heuristic for the margin at the top of the frame to avoid the
* node label clipping under the frame's child nodes. */
const float has_label = node.label[0] != '\0';
const float margin_top = margin + (has_label ? (margin * font_size / 24.0f) : 0.0f);
Seems to like magic numbers, what do you think, should it be more clear if add some comments about why
24.0f
?Yeah, looking back at this this doesn't really make sense.
The expression
margin * font_size / 24.0f
reduces to1.25f * U.dpi_size * font_size
. The1.25f
adds an additional 25% to account for the descender of the font. This doesn't work out for every font, but it seems to be a good enough guess that avoids duplicating the logic for the font size fromframe_node_draw_label
.I'll clean this up. Thanks for the feedback! :)
058ef3f38d
tod7222bac41
@blender-bot build