mirror of
https://github.com/alicevision/Meshroom.git
synced 2025-08-02 16:28:51 +02:00
[ui] GraphEditor: use maxZoom to fit on nodes (#1865)
This commit is contained in:
parent
2c7547e493
commit
56fe514582
1 changed files with 4 additions and 4 deletions
|
@ -14,6 +14,8 @@ Item {
|
|||
property variant uigraph: null /// Meshroom ui graph (UIGraph)
|
||||
readonly property variant graph: uigraph ? uigraph.graph : null /// core graph contained in ui graph
|
||||
property variant nodeTypesModel: null /// the list of node types that can be instantiated
|
||||
property real maxZoom: 2.0
|
||||
property real minZoom: 0.1
|
||||
|
||||
property var edgeAboutToBeRemoved: undefined
|
||||
|
||||
|
@ -151,8 +153,6 @@ Item {
|
|||
id: mouseArea
|
||||
anchors.fill: parent
|
||||
property double factor: 1.15
|
||||
property real minZoom: 0.1
|
||||
property real maxZoom: 2.0
|
||||
// Activate multisampling for edges antialiasing
|
||||
layer.enabled: true
|
||||
layer.samples: 8
|
||||
|
@ -799,8 +799,8 @@ Item {
|
|||
function fit() {
|
||||
// compute bounding box
|
||||
var bbox = boundingBox()
|
||||
// rescale
|
||||
draggable.scale = Math.min(root.width/bbox.width, root.height/bbox.height)
|
||||
// rescale to fit the bounding box in the view, zoom is limited to prevent huge text
|
||||
draggable.scale = Math.min(Math.min(root.width/bbox.width, root.height/bbox.height),maxZoom)
|
||||
// recenter
|
||||
draggable.x = bbox.x*draggable.scale*-1 + (root.width-bbox.width*draggable.scale)*0.5
|
||||
draggable.y = bbox.y*draggable.scale*-1 + (root.height-bbox.height*draggable.scale)*0.5
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue