*/}}
1
0
Pārlūkot izejas kodu

borderless color widget

YimingWu 1 gadu atpakaļ
vecāks
revīzija
71a3c74c0d
1 mainītis faili ar 14 papildinājumiem un 11 dzēšanām
  1. 14 11
      resources/la_widgets.c

+ 14 - 11
resources/la_widgets.c

@@ -729,7 +729,7 @@ void la_FloatDraw(laUiItem *ui, int h){
 void la_FloatArrayColorDraw(laUiItem *ui, int h){
     laBoxedTheme *bt = (*ui->Type->Theme);
     real Data[32];
-    int Len, i, Y = ui->U;
+    int Len, i;
     int IsColorful=ui->Flags&LA_UI_FLAGS_COLORFUL;
 
     laGetFloatArray(&ui->PP, Data);
@@ -741,24 +741,27 @@ void la_FloatArrayColorDraw(laUiItem *ui, int h){
     if(IsColorful){
         int sw=(ui->R-ui->L)/2;
         tnsColor4d(Data[0], Data[1], Data[2], 1);
-        tnsVertex2d(ui->L, Y); tnsVertex2d(ui->L+sw, Y);
-        tnsVertex2d(ui->L+sw, Y + h); tnsVertex2d(ui->L, Y + h);
+        tnsVertex2d(ui->L, ui->U); tnsVertex2d(ui->L+sw, ui->U);
+        tnsVertex2d(ui->L+sw, ui->B); tnsVertex2d(ui->L, ui->B);
         tnsPackAs(GL_TRIANGLE_FAN);
         tnsColor4d(Data[0], Data[1], Data[2], Len>3?Data[3]:1);
-        tnsVertex2d(ui->L+sw, Y); tnsVertex2d(ui->R, Y);
-        tnsVertex2d(ui->R, Y + h); tnsVertex2d(ui->L+sw, Y + h);
+        tnsVertex2d(ui->L+sw, ui->U); tnsVertex2d(ui->R, ui->U);
+        tnsVertex2d(ui->R, ui->B); tnsVertex2d(ui->L+sw, ui->B);
         tnsUseHalftone(1.0); tnsPackAs(GL_TRIANGLE_FAN); tnsUseHalftone(0.0);
     }else{
         tnsColor4d(Data[0], Data[1], Data[2], 1);
-        tnsVertex2d(ui->L, Y); tnsVertex2d(ui->R, Y);
-        tnsVertex2d(ui->R, Y + h); tnsVertex2d(ui->L, Y + h);
+        tnsVertex2d(ui->L, ui->U); tnsVertex2d(ui->R, ui->U);
+        tnsVertex2d(ui->R, ui->B); tnsVertex2d(ui->L, ui->B);
         tnsPackAs(GL_TRIANGLE_FAN);
     }
 
-    tnsColor4dv(laThemeColor(bt,LA_BT_BORDER));
-    tnsVertex2d(ui->L, Y); tnsVertex2d(ui->R, Y);
-    tnsVertex2d(ui->R, Y + h); tnsVertex2d(ui->L, Y + h);
-    tnsPackAs(GL_LINE_LOOP);
+    int NoDecal=ui->Flags&LA_UI_FLAGS_NO_DECAL;
+    if(!NoDecal){
+        tnsColor4dv(laThemeColor(bt,LA_BT_BORDER));
+        tnsVertex2d(ui->L, ui->U); tnsVertex2d(ui->R, ui->U);
+        tnsVertex2d(ui->R, ui->B); tnsVertex2d(ui->L, ui->B);
+        tnsPackAs(GL_LINE_LOOP);
+    }
 
     tnsFlush();
 }