[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Sc-devel] Pen: bug with fillRect, fillOval and fillColor



hi sciss,
there's something wrong with the order. fill after stroke and it works. i sort of noticed this before but thought it was me being too tired.


GUI.cocoa;
(
var width= 640, height= 480, w, drawFunc;
w= GUI.window.new("trail test3", Rect(128, 64, width, height), false);
drawFunc= {|v|
GUI.pen.strokeColor_(Color.green);
GUI.pen.fillColor_(Color.blue);
// these should be blue, but in fact they are green
GUI.pen.fillRect(Rect.aboutPoint(Point(100,100), 60, 40));
GUI.pen.fillOval(Rect.aboutPoint(Point(300,100), 60, 40));
GUI.pen.strokeRect(Rect.aboutPoint(Point(100,100), 60, 40)+100);
GUI.pen.strokeOval(Rect.aboutPoint(Point(300,100), 60, 40)+100);

};
x = GUI.userView.new(w, Rect(10, 10, width-20, height-20)).drawFunc_ (drawFunc);
w.front;
)



Am 24.11.2007 um 22:07 schrieb Sciss:

hi (jan),

i found a bug in Pen,
fillRect and fillOval (and maybe others?) are using the strokeColor, not the fillColor:

GUI.cocoa;
(
var width= 640, height= 480, w, drawFunc;
w= GUI.window.new("trail test3", Rect(128, 64, width, height), false);
drawFunc= {|v|
GUI.pen.fillColor_(Color.blue);
GUI.pen.strokeColor_(Color.green);
// these should be blue, but in fact they are green
GUI.pen.fillRect(Rect.aboutPoint(Point(100,100), 60, 40));
GUI.pen.fillOval(Rect.aboutPoint(Point(300,100), 60, 40));
};
x = GUI.userView.new(w, Rect(10, 10, width-20,
height-20)).drawFunc_(drawFunc);
w.front;
)


ciao, -sciss-


  #|
     fredrikolofsson.com     klippav.org     musicalfieldsforever.com
  |#