Fix #111841: Prevent node title text overlap with icon #112940
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#112940
Loading…
Reference in New Issue
No description provided.
Delete Branch "Semen-Komissarov/blender:geom-nodes-title-text-icon-overlap"
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?
In Geometry Nodes editor, some nodes have title text overlap with icon, which can be observed via rescaling, e.g. in Node Context Menu:
Tested on two monitors, both running Windows: 4k and laptop 1080p. Probably requires approve of mac / linux user.
Fix #111841: prevent node title text overlap with icon (e.g. add hair, add link to other node group)to Draft: Fix #111841: prevent node title text overlap with icon (e.g. add hair, add link to other node group)Draft: Fix #111841: prevent node title text overlap with icon (e.g. add hair, add link to other node group)to Fix #111841: prevent node title text overlap with icon (e.g. add hair, add link to other node group)Thanks for fix. I haven't gone deep into this, but i believe that text size and border should have a more formal definition.
@ -2655,6 +2655,9 @@ static void node_draw_extra_info_panel(const Scene *scene,
}
}
// prevents node title text overlap with icon. (e.g. add hair, add link to other node group)
https://wiki.blender.org/wiki/Style_Guide/C_Cpp#Comments
adjusted
removed in last commit
@ -2656,2 +2656,4 @@
}
// prevents node title text overlap with icon. (e.g. add hair, add link to other node group)
#define NODE_TITLE_ICON_OFFSET_MAGIC (18.0f + 12.0f)
Please, use
static constexpr float
instead of macros.fixed
removed in last commit
Thanks for heads up. I think I got perfect alignment for group nodes, replacing magic with icon size and reasonable constants.
first attempt looked impresize, briefing text prematurely, before touching icon edge
610a37e49f
to5964ff7acb
Fix #111841: prevent node title text overlap with icon (e.g. add hair, add link to other node group)to Fix #111841: Prevent node title text overlap with iconSorry for delay, i just checked this:
Bug still occur.
@mod_moder
please tell menu name and how to access it.
I've enumerated 2 fixed cases:
and they were using same method for offset
but your menu on screenshot is different, I cant find it
I have a feeling you're not on my branch, could you double check you pulled last changes please?
I just did recheck and i pretty sure what that is not worked. It might depend on screen size thought.
figured out it depends on desktop resolution scale. it works on desktop scale 150% but doesnt work for 100%. (checked on 4k monitor where scale was 150% and then reproduced bug on laptop 1080p with scale 100%. when changed laptop to 150% - no bug, perfect fit. 125% has a little overlap).
which is a bit weird. previous solution with hardcoded constants worked on both machines.
now need to find some other convenient variable representing desktop scale, or check other size scale dependent variables. in current approach, looks like UI_SCALE_FAC is not enough
U.widget_unit
?replaced UI_SCALE_FAC for constant 1.5 (150%), which fits perfectly scales 100 to 300 %. Sometimes empirical magic beats reasoning).
thanks for reproducing issue again
please review
Now that works for me.
@ -2744,6 +2744,14 @@ static void node_draw_extra_info_panel(const Scene *scene,
}
}
BLI_INLINE float node_draw_get_node_group_width(const float iconofs, const rctf &rct)
I not sure if
BLI_INLINE
is really needed here.it changes to __forceinline, reducing compilation time in some cases? to not rely on compiler judgement. I just saw it is used everywhere and documented https://wiki.blender.org/wiki/Style_Guide/C_Cpp as
@ -2746,1 +2746,4 @@
BLI_INLINE float node_draw_get_node_group_width(const float iconofs, const rctf &rct)
{
const float iconbutw = NODE_HEADER_ICON_SIZE;
It is the necessary variable?
to be consistent with naming in other functions. in case of any change to
iconbutw
variable in other functions, this hints "consider also changing it here"@ -2747,0 +2747,4 @@
BLI_INLINE float node_draw_get_node_group_width(const float iconofs, const rctf &rct)
{
const float iconbutw = NODE_HEADER_ICON_SIZE;
// it was iconbutw * UI_SCALE_FAC, where UI_SCALE_FAC == 1.5 fits perfectly (150% resolution
Comment style
sorry, adjusted
Hi, thanks for working on this.
I haven't looked too deeply into the problem, but to me it feels like the current PR is a bit more complicated than it needs to be.
This small diff seems to do the trick for me, but maybe I'm missing something:
To elaborate:
iconofs
is representing the x location of the drawing icons (which is offset to the left with each icon that is drawn). So to properly calculate the available space for the label we just check the distance between where our label start (labelbut_x
) and where it's supposed to end (iconofs
).I think the current diff works because
iconbutw * 1.5
works out to be roughly the same asNODE_MARGIN_X + 0.4f
.@lone_noel your solution looks better, will you prepare PR?
also makes sense replace hardcoded magic in
node_draw_hidden
? next function in file, similar hardcoded offsetsI probably won't have time before the end of the week. So if you confirmed that diff works for you, as well, feel free to just update this PR.
node_draw_hidden
is a bit different, since these icons aren't shown on hidden nodes.On hidden nodes there's that scale widget on the right that can conflict with the label. Especially since that widget scales a bit oddly currently (the width is constant in screen space).
If you want you could take a stab at fixing that in a similar fashion, too, and maybe even improve the width scaling of the widget while you're at it.
979a4eeec6
to5f49efc084
@mod_moder switched to Leon's solution, please review again
Yep, that still works
Thanks all for that
It seems like this fell through the cracks. Sorry about that, @Semen-Komissarov!
I just tested it and the change still applies cleanly and fixes the issue.
Checkout
From your project repository, check out a new branch and test the changes.