*/}}
Browse Source

Save layout in preferences

YimingWu 1 year ago
parent
commit
6843aae0a3
2 changed files with 15 additions and 15 deletions
  1. 1 1
      ouroperations.c
  2. 14 14
      ourpaint.c

+ 1 - 1
ouroperations.c

@@ -1554,7 +1554,7 @@ int ourinv_BrushQuickSwitch(laOperator* a, laEvent* e){
 int ourinv_BrushResize(laOperator* a, laEvent* e){
     OurBrush* b=Our->CurrentBrush; if(!b) return LA_CANCELED;
     char* direction=strGetArgumentString(a->ExtraInstructionsP,"direction");
-    if(strSame(direction,"bigger")){ b->Size*=1.1; }else{ b->Size/=1.1; }
+    if(strSame(direction,"bigger")){ b->Size*=1.25; }else{ b->Size/=1.25; }
     TNS_CLAMP(b->Size,0,1000);
     laNotifyUsers("our.tools.current_brush.size");
     return LA_FINISHED;

+ 14 - 14
ourpaint.c

@@ -41,20 +41,20 @@ int main(int argc, char *argv[]){
     //laAddRootDBInst("la.input_mapping");
     //laAddRootDBInst("la.drivers");
     //laAddRootDBInst("our.tools");
+    if(!MAIN.Windows.pFirst){
+        laWindow* w = laDesignWindow(-1,-1,35*LA_RH,25*LA_RH);
+        laLayout* l = laDesignLayout(w, "Our Paint");
+        laBlock* b = l->FirstBlock;
+        laSplitBlockHorizon(b,0.7);
+        laCreatePanel(b->B1, "panel_canvas");
+        laBlock* br=b->B2;
+        laSplitBlockVertical(br,0.6);
+        laCreatePanel(br->B1, "panel_color");
+        laCreatePanel(br->B1, "panel_tools");
+        laCreatePanel(br->B1, "panel_brushes");
+        laCreatePanel(br->B2, "panel_layers");
+        laStartWindow(w);
+    }
 
-    laWindow* w = laDesignWindow(-1,-1,35*LA_RH,25*LA_RH);
-
-    laLayout* l = laDesignLayout(w, "Our Paint");
-    laBlock* b = l->FirstBlock;
-    laSplitBlockHorizon(b,0.7);
-    laCreatePanel(b->B1, "panel_canvas");
-    laBlock* br=b->B2;
-    laSplitBlockVertical(br,0.6);
-    laCreatePanel(br->B1, "panel_color");
-    laCreatePanel(br->B1, "panel_tools");
-    laCreatePanel(br->B1, "panel_brushes");
-    laCreatePanel(br->B2, "panel_layers");
-
-    laStartWindow(w);
     laMainLoop();
 }