*/}}
Selaa lähdekoodia

Clean up & canvas local xy correction

YimingWu 1 vuosi sitten
vanhempi
commit
912015bceb
4 muutettua tiedostoa jossa 11 lisäystä ja 13 poistoa
  1. 6 6
      la_kernel.c
  2. 1 3
      la_tns.h
  3. 1 1
      resources/la_operators.c
  4. 3 3
      resources/la_widgets_viewers.c

+ 6 - 6
la_kernel.c

@@ -3334,8 +3334,8 @@ void laWindowToLocal(laOperator *a, laPanel *p, int *x, int *y){
     int ix = *x, iy = *y;
     laListItemPointer *lip;
     laOperator *ai = a;
-    (*x) = ix - p->X;
-    (*y) = iy - p->Y;
+    (*x) = ix - ((MAIN.CurrentWindow->MaximizedUiPanel==p)?0: p->X);
+    (*y) = iy - ((MAIN.CurrentWindow->MaximizedUiPanel==p)?0: p->Y);
     if (a){
         for (lip = ai->LocalUiLists.pFirst; lip; lip = lip->pNext){
             laUiList *uil = lip->p;
@@ -3359,8 +3359,8 @@ void laLocalToWindow(laOperator *a, laPanel *p, int *x, int *y){
     if(!p) return;
     int ix = *x, iy = *y;
     laListItemPointer *lip;
-    (*x) = ix + p->X;
-    (*y) = iy + p->Y;
+    (*x) = ix + ((MAIN.CurrentWindow->MaximizedUiPanel==p)?0: p->X);
+    (*y) = iy + ((MAIN.CurrentWindow->MaximizedUiPanel==p)?0: p->Y);
     if (a){
         for (lip = a->LocalUiLists.pFirst; lip; lip = lip->pNext){
             laUiList *uil = lip->p;
@@ -3372,8 +3372,8 @@ void laLocalToWindow(laOperator *a, laPanel *p, int *x, int *y){
 void laPanelToWindow(laPanel *p, int *x, int *y){
     int ix = *x, iy = *y;
     laListItemPointer *lip;
-    (*x) = ix + p->X;
-    (*y) = iy + p->Y;
+    (*x) = ix + ((MAIN.CurrentWindow->MaximizedUiPanel==p)?0: p->X);
+    (*y) = iy + ((MAIN.CurrentWindow->MaximizedUiPanel==p)?0: p->Y);
 }
 void laLocalToPanel(laOperator *a, int *x, int *y){
     int ix = *x, iy = *y;

+ 1 - 3
la_tns.h

@@ -592,9 +592,7 @@ STRUCTURE(tnsEvaluateData){
     tnsEvaluatedInstance* Selections; int NextSelection, MaxSelection;
 };
 
-typedef struct _tnsObject tnsObject;
-struct _tnsObject
-{
+STRUCTURE(tnsObject){
     laListItem Item;
 
     int Type;

+ 1 - 1
resources/la_operators.c

@@ -1526,7 +1526,7 @@ int OPMOD_Window(laOperator *a, laEvent *e){
     if(w->MaximizedUi && w->MaximizedUiPanel){
         if(((e->y<LA_RH && e->x<LA_RH)||e->y<LA_SEAM_W) && uid->Dragging){ laShowMenuBar(); uid->Dragging=0; }
         if(!la_UiOperatorExists(w->MaximizedUi)){
-            laSetOperatorLocalizer(0);
+            laSetOperatorLocalizer(w->MaximizedUiPanel);
             laInvokeUi(a, w->MaximizedUi->Type->OperatorID, e, w->MaximizedUi, 0, 1);
             return LA_RUNNING;
         }

+ 3 - 3
resources/la_widgets_viewers.c

@@ -749,16 +749,16 @@ int OPMOD_Canvas(laOperator *a, laEvent *e){
         int state=VeryClose?(btn?LA_UI_EDITING:LA_UI_ACTIVE):LA_UI_NORMAL;
         if(state!=ui->State){ ui->State=state; laRedrawCurrentPanel(); }
     }
-    //laLocalToPanel(a, &px, &py);
 
     if(!(ui->Flags&LA_UI_FLAGS_NO_OVERLAY)){
         for (subu = ui->Subs.pFirst; subu; subu = subu->Item.pNext){
             if (subui = la_DetectUiItemRecursive(subu, px, py, ui->B, &Locals, 0)){
                 if (subui && !a->Child && subui->Type->OperatorType){
-                    //printf("invui %d\n", tui);
                     laUiList *luil = ((laUiListDrawItem *)Locals.pFirst)->Target;
                     laSetOperatorLocalizer(a->ToPanel);
-                    if (laInvokeUiP(a, subui->Type->OperatorType, e, subui, &Locals, 0) >= 0) laRetriggerOperators();
+                    if(subui && !a->Child && subui->Type->OperatorType && !la_UiOperatorExists(subui)){
+                        if (laInvokeUiP(a, subui->Type->OperatorType, e, subui, &Locals, 0) >= 0); laRetriggerOperators();
+                    }
                     lstClearPointer(&Locals);
                     return LA_RUNNING_PASS;
                 }