mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-02-21 07:14:11 +00:00
Remove scaling of context menus (#431)
* remove scaling of context menus based on graph scale * deprecate scale in interface * Add option to restore old context scaling behaviour Revert "remove scaling of context menus based on graph scale" This reverts commit d91ecaa86c671aea272844c3900a18da1af7bf01. * Update test expectations --------- Co-authored-by: filtered <176114999+webfiltered@users.noreply.github.com>
This commit is contained in:
@@ -181,7 +181,9 @@ export class ContextMenu {
|
||||
root.style.left = left + "px"
|
||||
root.style.top = top + "px"
|
||||
|
||||
if (options.scale) root.style.transform = `scale(${Math.round(options.scale * 4) * 0.25})`
|
||||
if (LiteGraph.context_menu_scaling && options.scale) {
|
||||
root.style.transform = `scale(${Math.round(options.scale * 4) * 0.25})`
|
||||
}
|
||||
}
|
||||
|
||||
addItem(
|
||||
|
||||
@@ -257,6 +257,9 @@ export class LiteGraphGlobal {
|
||||
/** If `true`, the old "eye-melting-red" error indicator will be used for nodes */
|
||||
use_legacy_node_error_indicator = false
|
||||
|
||||
/** Whether to scale context with the graph when zooming in. Zooming out never makes context menus smaller. */
|
||||
context_menu_scaling = false
|
||||
|
||||
// TODO: Remove legacy accessors
|
||||
LGraph = LGraph
|
||||
LLink = LLink
|
||||
|
||||
@@ -273,6 +273,7 @@ export interface IContextMenuOptions extends IContextMenuBase {
|
||||
scroll_speed?: number
|
||||
left?: number
|
||||
top?: number
|
||||
/** @deprecated Context menus no longer scale using transform */
|
||||
scale?: number
|
||||
node?: LGraphNode
|
||||
autoopen?: boolean
|
||||
|
||||
@@ -142,6 +142,7 @@ LiteGraphGlobal {
|
||||
"auto_sort_node_types": false,
|
||||
"catch_exceptions": true,
|
||||
"click_do_break_link_to": false,
|
||||
"context_menu_scaling": false,
|
||||
"ctrl_alt_click_do_break_link": true,
|
||||
"ctrl_shift_v_paste_connect_unselected_outputs": true,
|
||||
"debug": false,
|
||||
|
||||
Reference in New Issue
Block a user