*/}}
YimingWu 3 månader sedan
förälder
incheckning
f7bf9ce697
1 ändrade filer med 7 tillägg och 5 borttagningar
  1. 7 5
      resources/la_widgets_viewers.c

+ 7 - 5
resources/la_widgets_viewers.c

@@ -1018,11 +1018,13 @@ int OPINV_3DOr2DViewAdjust(laOperator *a, laEvent *e){
     if(a->Type->Modal == OPMOD_CanvasMove && a->This->EndInstance){
         laCanvasExtra* cex=a->This->EndInstance;
         char* str=strGetArgumentString(a->ExtraInstructionsP,"pan");
-        if(strSame(str,"left")){ cex->PanX -= (LA_RH) * cex->ZoomX; }
-        elif(strSame(str,"right")){ cex->PanX += (LA_RH) * cex->ZoomX; }
-        elif(strSame(str,"up")){ cex->PanY += (LA_RH) * cex->ZoomY; }
-        elif(strSame(str,"down")){ cex->PanY -= (LA_RH) * cex->ZoomY; }
-        return LA_FINISHED;
+        if(str){
+            if(strSame(str,"left")){ cex->PanX -= (LA_RH) * cex->ZoomX; }
+            elif(strSame(str,"right")){ cex->PanX += (LA_RH) * cex->ZoomX; }
+            elif(strSame(str,"up")){ cex->PanY += (LA_RH) * cex->ZoomY; }
+            elif(strSame(str,"down")){ cex->PanY -= (LA_RH) * cex->ZoomY; }
+            return LA_FINISHED;
+        }
     }
 
     return LA_RUNNING;