[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [20337] branches/blender2.5/blender/source /blender/editors/interface/interface_widgets.c: 2.5
Ton Roosendaal
ton at blender.org
Fri May 22 11:09:08 CEST 2009
Revision: 20337
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=20337
Author: ton
Date: 2009-05-22 11:09:07 +0200 (Fri, 22 May 2009)
Log Message:
-----------
2.5
Fix in sliders; didn't notice the left part messed up :)
Another slider draw method to explore would be like this:
(<| -------- |>)
Would make it symmetrical, and visually matching number
buttons better. (the "<" is background color triangle,
without circle around it).
Modified Paths:
--------------
branches/blender2.5/blender/source/blender/editors/interface/interface_widgets.c
Modified: branches/blender2.5/blender/source/blender/editors/interface/interface_widgets.c
===================================================================
--- branches/blender2.5/blender/source/blender/editors/interface/interface_widgets.c 2009-05-22 07:41:36 UTC (rev 20336)
+++ branches/blender2.5/blender/source/blender/editors/interface/interface_widgets.c 2009-05-22 09:09:07 UTC (rev 20337)
@@ -1391,23 +1391,31 @@
widgetbase_draw(&wtb, wcol);
/* slider part */
+ VECCOPY(outline, wcol->outline);
+ VECCOPY(wcol->outline, wcol->item);
+ VECCOPY(wcol->inner, wcol->item);
+ SWAP(short, wcol->shadetop, wcol->shadedown);
+
rect1= *rect;
value= ui_get_but_val(but);
fac= (value-but->softmin)*(rect1.xmax - rect1.xmin - offs)/(but->softmax - but->softmin);
+ /* left part of slider, always rounded */
+ rect1.xmax= rect1.xmin + ceil(offs+1.0f);
+ round_box_edges(&wtb1, roundboxalign & ~6, &rect1, offs);
+ wtb1.outline= 0;
+ widgetbase_draw(&wtb1, wcol);
+
+ /* right part of slider, interpolate roundness */
rect1.xmax= rect1.xmin + fac + offs;
+ rect1.xmin+= floor(offs-1.0f);
if(rect1.xmax + offs > rect->xmax)
offs*= (rect1.xmax + offs - rect->xmax)/offs;
else
offs= 0.0f;
- round_box_edges(&wtb1, roundboxalign, &rect1, offs);
+ round_box_edges(&wtb1, roundboxalign & ~9, &rect1, offs);
- VECCOPY(outline, wcol->outline);
- VECCOPY(wcol->outline, wcol->item);
- VECCOPY(wcol->inner, wcol->item);
- SWAP(short, wcol->shadetop, wcol->shadedown);
-
widgetbase_draw(&wtb1, wcol);
VECCOPY(wcol->outline, outline);
SWAP(short, wcol->shadetop, wcol->shadedown);
More information about the Bf-blender-cvs
mailing list