Fix for
* [#35724] Backdrop zoom can be set to a very small value, making the backdrop disapear. There were checks in the drawnode that needed to be placed in the readfile. The checks checked if the zoomlevel was 0.0, then it was defaulted to 1.0, but the zoomvalue had a minimum limit of 0.01, hence it did not work. Moved the check to the readfile and checked for all values smaller then 0.02. These values are then reset to 1.0 Jeroen & Monique - At Mind -
This commit is contained in:
@@ -9476,6 +9476,7 @@ static void do_versions(FileData *fd, Library *lib, Main *main)
|
||||
|
||||
|
||||
{
|
||||
bScreen *sc;
|
||||
Object *ob;
|
||||
|
||||
for (ob = main->object.first; ob; ob = ob->id.next) {
|
||||
@@ -9491,6 +9492,28 @@ static void do_versions(FileData *fd, Library *lib, Main *main)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* FIX some files have a zoom level of 0, and was checked during the drawing of the node space
|
||||
*
|
||||
* We moved this check to the do versions to be sure the value makes any sense.
|
||||
*/
|
||||
for (sc = main->screen.first; sc; sc = sc->id.next) {
|
||||
ScrArea *sa;
|
||||
for (sa = sc->areabase.first; sa; sa = sa->next) {
|
||||
SpaceLink *sl;
|
||||
for (sl = sa->spacedata.first; sl; sl = sl->next) {
|
||||
if (sl->spacetype == SPACE_NODE)
|
||||
{
|
||||
SpaceNode *snode = (SpaceNode *)sl;
|
||||
if (snode->zoom < 0.02)
|
||||
{
|
||||
snode->zoom = 1.0;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* WATCH IT!!!: pointers from libdata have not been converted yet here! */
|
||||
|
||||
@@ -2021,9 +2021,6 @@ static void node_composit_backdrop_boxmask(SpaceNode *snode, ImBuf *backdrop, bN
|
||||
float y1, y2, y3, y4;
|
||||
|
||||
|
||||
/* keep this, saves us from a version patch */
|
||||
if (snode->zoom == 0.0f) snode->zoom = 1.0f;
|
||||
|
||||
glColor3f(1.0, 1.0, 1.0);
|
||||
|
||||
cx = x + snode->zoom * backdropWidth * boxmask->x;
|
||||
@@ -2062,9 +2059,6 @@ static void node_composit_backdrop_ellipsemask(SpaceNode *snode, ImBuf *backdrop
|
||||
float y1, y2, y3, y4;
|
||||
|
||||
|
||||
/* keep this, saves us from a version patch */
|
||||
if (snode->zoom == 0.0f) snode->zoom = 1.0f;
|
||||
|
||||
glColor3f(1.0, 1.0, 1.0);
|
||||
|
||||
cx = x + snode->zoom * backdropWidth * ellipsemask->x;
|
||||
@@ -2886,9 +2880,6 @@ void draw_nodespace_back_pix(const bContext *C, ARegion *ar, SpaceNode *snode, b
|
||||
glMatrixMode(GL_MODELVIEW);
|
||||
glPushMatrix();
|
||||
|
||||
/* keep this, saves us from a version patch */
|
||||
if (snode->zoom == 0.0f) snode->zoom = 1.0f;
|
||||
|
||||
/* somehow the offset has to be calculated inverse */
|
||||
|
||||
glaDefine2DArea(&ar->winrct);
|
||||
|
||||
Reference in New Issue
Block a user