Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorErik <ecke101@gmail.com>2021-11-17 03:42:42 +0300
committerErik <ecke101@gmail.com>2021-11-18 23:24:55 +0300
commit3f288e94140c3520dc88959bcae6af675f299318 (patch)
treee1453ee92fa236e37fe22a1e24e2d027ad9cdd38 /source/blender
parentb2d37c35d068ee9a58f9d92936b286178feaf0fc (diff)
Node Editor: Change minimum zoom
Now with Geometry Nodes in Blender, trees can become much bigger than before. This changes the minimum zoom value in the node editor. Differential Revision: https://developer.blender.org/D13254
Diffstat (limited to 'source/blender')
-rw-r--r--source/blender/blenloader/intern/versioning_300.c19
-rw-r--r--source/blender/editors/space_node/space_node.cc2
2 files changed, 20 insertions, 1 deletions
diff --git a/source/blender/blenloader/intern/versioning_300.c b/source/blender/blenloader/intern/versioning_300.c
index e0e59600704..b8004f60c59 100644
--- a/source/blender/blenloader/intern/versioning_300.c
+++ b/source/blender/blenloader/intern/versioning_300.c
@@ -2194,5 +2194,24 @@ void blo_do_versions_300(FileData *fd, Library *UNUSED(lib), Main *bmain)
}
}
}
+
+ /* Change minimum zoom to 0.05f in the node editor. */
+ LISTBASE_FOREACH (bScreen *, screen, &bmain->screens) {
+ LISTBASE_FOREACH (ScrArea *, area, &screen->areabase) {
+ LISTBASE_FOREACH (SpaceLink *, sl, &area->spacedata) {
+ if (sl->spacetype == SPACE_NODE) {
+ ListBase *regionbase = (sl == area->spacedata.first) ? &area->regionbase :
+ &sl->regionbase;
+ LISTBASE_FOREACH (ARegion *, region, regionbase) {
+ if (region->regiontype == RGN_TYPE_WINDOW) {
+ if (region->v2d.minzoom > 0.05f) {
+ region->v2d.minzoom = 0.05f;
+ }
+ }
+ }
+ }
+ }
+ }
+ }
}
}
diff --git a/source/blender/editors/space_node/space_node.cc b/source/blender/editors/space_node/space_node.cc
index a94deb97f42..72861732b27 100644
--- a/source/blender/editors/space_node/space_node.cc
+++ b/source/blender/editors/space_node/space_node.cc
@@ -285,7 +285,7 @@ static SpaceLink *node_create(const ScrArea *UNUSED(area), const Scene *UNUSED(s
region->v2d.max[0] = 32000.0f;
region->v2d.max[1] = 32000.0f;
- region->v2d.minzoom = 0.09f;
+ region->v2d.minzoom = 0.05f;
region->v2d.maxzoom = 2.31f;
region->v2d.scroll = (V2D_SCROLL_RIGHT | V2D_SCROLL_BOTTOM);