[sc-users] Drawing strings ?
Andre Bartetzki
andre at bartetzki.de
Sun Dec 10 13:59:25 PST 2006
Es war der 10.12.2006 13:49 Uhr, als itsydummy nicht widerstehen konnte,
folgende Gedanken dem Netz anzuvertrauen:
>
> Does not work for me too but there was an argument missing in the
> String.bounds method. May be your build has the same problem.
>
> In the .sc file the font argument is not specified in the
> StringPlusGUI.sc file, and in the source we need this argument to
> calculate the size (in GUIPrimitives.cpp)
> try to replace:
>
> bounds { ^this.prBounds(Rect.new) }
> prBounds { arg rect;
> _String_GetBounds
> ^this.primitiveFailed
> }
>
> with_
>
> bounds { arg font=Font("Monaco", 9); ^this.prBounds(Rect.new,
> font) } // or any font you usually use
> prBounds { arg rect, font;
> _String_GetBounds
> ^this.primitiveFailed
> }
That's it!!
Thanks!
Could somebody submit these changes?
I think the default arg for font should be Font.default, like
bounds { arg font=Font.default;
^this.prBounds(Rect.new, font)
}
Andre
--------------------------------------------------
Andre Bartetzki
http://www.bartetzki.de
mailto:andre at bartetzki.de
Tel +49-(0)30-92375877
VoIP +49-(0)30-38108677
Fax +49-(0)30-38108678
UMS +49-(0)941-599214065 (Voice, Fax, SMS)
Skype bartetzki
--------------------------------------------------
More information about the sc-users
mailing list