Graph Editor : Font and plug logic updates - #3014
Conversation
Trial of using circles on boundary of node vs interior.
…l alignment. Fix crash in unrelated code.
| ed::PinId _pinIdToLinkTo; | ||
|
|
||
| // DPI scaling for fonts | ||
| float _fontScale; |
There was a problem hiding this comment.
Scaling is relative to actual font used now and is computed.
|
|
||
| // DPI scaling for fonts | ||
| float _fontScale; | ||
| // Offset pin placement to be on border of node vs inside. |
| glDisable(GL_FRAMEBUFFER_SRGB); | ||
| } | ||
|
|
||
| static float getUiScaleFromFont() |
| ImVec2 iconMin = ImGui::GetCursorScreenPos() + ImVec2(xOffset, 0.0f); | ||
| ImVec2 iconMax = iconMin + ImVec2(iconSize, iconSize); | ||
|
|
||
| if (_pinIconShape == (unsigned int)ax::Drawing::IconType::Circle) |
There was a problem hiding this comment.
Want circle without an arrow after it which is hard-coded into DrawIcon(). Also provide explicit center and size hotspot control.
| @@ -1995,63 +2060,80 @@ bool Graph::readOnly() | |||
|
|
|||
| void Graph::drawOutputPins(UiNodePtr node, const std::string& longestInputLabel) | |||
There was a problem hiding this comment.
Calcuates taking font size into account, and adds indent control
| " --path [FILEPATH] Specify an additional data search path location (e.g. '/projects/MaterialX'). This absolute path will be queried when locating data libraries, XInclude references, and referenced images.\n" | ||
| " --library [FILEPATH] Specify an additional data library folder (e.g. 'vendorlib', 'studiolib'). This relative path will be appended to each location in the data search path when loading data libraries.\n" | ||
| " --uiScale [FACTOR] Manually specify a UI scaling factor\n" | ||
| " --uiScale [FACTOR] Additional UI scale multiplier applied on top of detected device scale\n" |
There was a problem hiding this comment.
Scaling still affects informational areas : property editor, menus, popups etc but as noted is computed consider font used.
| io.IniFilename = NULL; | ||
| io.LogFilename = NULL; | ||
|
|
||
| // Derive a single effective UI scale from device DPI and optional CLI multiplier. |
There was a problem hiding this comment.
Consider DPI for font so you don't get blurred fonts at higher DPI settings.
| } | ||
| // Handle DPI scaling for ImGui style metrics. | ||
| ImGuiStyle& style = ImGui::GetStyle(); | ||
| style.ScaleAllSizes(effectiveUiScale); |
There was a problem hiding this comment.
Apply scaling appropriately to entire style.
| ed::SetCurrentEditor(editorContext); | ||
| ed::Style& editorStyle = ed::GetStyle(); | ||
| editorStyle.NodeRounding = 5.0f; | ||
| editorStyle.NodeRounding = 8.0f; |
| inputValue = input->getInterfaceInput()->getValueString(); // Get value from referenced interface | ||
| { | ||
| mx::InputPtr interfaceInput = input->getInterfaceInput(); | ||
| if (interfaceInput) |
There was a problem hiding this comment.
Fix crash found drilling down into nodedef nodegraphs.
|
@lfl-eholthouser : Leaving a ping with you for your thoughts. Thanks. These changes should effectively fix up a bunch of font issues accumulate over time to have a consistent font in all UI places and not try and adversely scale graph node text which affects formatting and fltering. Formatting is important since alignment issues would occur before with pins + text. Secondly based on @HardCoreCodin's comments in Slack, I have added in additional pin placement / shape options which required cleaning up the font stuff. (BTW, it also fixes up some inconsistent icon vs hotspot placement / sizing). |
|
@kwokcb These changes look great to me. I really like the option to have the pins on the border of the node. I think that looks really nice! |
Changes
Fixes
Fix up issues related to font changes.
Command Line Options
--pinsOnBorder). Default is true.--pinShape). Default is "circle". Options are "circle" and "flow" (previous) for now.Results
Consistent Text Scaling
Plug Placement
Previous plug layout possible using options: