Page MenuHome

SliderUI_Fix.patch

SliderUI_Fix.patch

Index: source/blender/editors/interface/interface_widgets.c
===================================================================
--- source/blender/editors/interface/interface_widgets.c (revision 32289)
+++ source/blender/editors/interface/interface_widgets.c (working copy)
@@ -283,9 +283,16 @@
float maxyi= maxy - 1.0f;
float facxi= (maxxi!=minxi) ? 1.0f/(maxxi-minxi) : 0.0f; /* for uv, can divide by zero */
float facyi= (maxyi!=minyi) ? 1.0f/(maxyi-minyi) : 0.0f;
- int a, tot= 0, minsize;
+ int a, tot= 0, minsize, hnum, vnum;
- minsize= MIN2(rect->xmax-rect->xmin, rect->ymax-rect->ymin);
+
+ if((roundboxalign & 1 && roundboxalign & 2) || (roundboxalign & 4 && roundboxalign & 8))
+ {hnum=1;} else hnum=2;
+
+ if((roundboxalign & 1 && roundboxalign & 8) || (roundboxalign & 2 && roundboxalign & 4))
+ {vnum=1;} else vnum=2;
+
+ minsize= MIN2((rect->xmax-rect->xmin)*hnum, (rect->ymax-rect->ymin)*vnum);
if(2.0f*rad > minsize)
rad= 0.5f*minsize;
@@ -2219,7 +2226,7 @@
uiWidgetBase wtb, wtb1;
rcti rect1;
double value;
- float offs, fac;
+ float offs, toffs, fac;
char outline[3];
widget_init(&wtb);
@@ -2229,6 +2236,7 @@
/* fully rounded */
offs= 0.5f*(rect->ymax - rect->ymin);
+ toffs = offs*0.75f;
round_box_edges(&wtb, roundboxalign, rect, offs);
wtb.outline= 0;
@@ -2274,8 +2282,8 @@
widgetbase_draw(&wtb, wcol);
/* text space */
- rect->xmin += offs*0.75f;
- rect->xmax -= offs*0.75f;
+ rect->xmin += toffs;
+ rect->xmax -= toffs;
}
/* I think 3 is sufficient border to indicate keyed status */

File Metadata

Mime Type
text/x-diff
Storage Engine
local-disk
Storage Format
Raw Data
Storage Handle
bc/0a/3b5cc126c5fdb306a0744d2d0d9c

Event Timeline