[Cuis-dev] Pretty Cool Juan!
Juan Vuletich
juan at jvuletich.org
Mon Jan 18 12:34:20 PST 2021
On 1/14/2021 10:57 AM, Hilaire Fernandes via Cuis-dev wrote:
> addLabel: string font: font centeredAt: position rotationDegrees: angle
> "Add a label top-centered at position and rotated of angle degrees"
> | p label |
> p _ position - (position normal * (font widthOfString: string asString) / 2).
> label _ LabelMorph contents: string font: font.
> label rotation: (90 - angle) degreesToRadians.
> self addMorph: label.
> label morphPosition: p.
> ^ label
Thanks Hilaire!
I added this as an extension method in VectorGraphics, as it won't work
without it.
Cheers,
--
Juan Vuletich
www.cuis-smalltalk.org
https://github.com/Cuis-Smalltalk/Cuis-Smalltalk-Dev
https://github.com/jvuletich
https://www.linkedin.com/in/juan-vuletich-75611b3
@JuanVuletich
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.cuis.st/mailman/archives/cuis-dev/attachments/20210118/2b96434e/attachment.htm>
More information about the Cuis-dev
mailing list