[squeak-dev] Speaking of rounded corners...
Marcel Taeumel
marcel.taeumel at student.hpi.uni-potsdam.de
Tue Feb 24 17:02:39 UTC 2015
I think that the CornerRounder is not appropriate. It's a hack like its class
comment sais. ;-)
What about using the methods from FormCanvas to draw rounded rectangles? The
result would be nicer because we could play with anti-aliasing:
<http://forum.world.st/file/n4807342/window-corners.png>
BUT: Pharo dismissed that interface from canvas and I was wondering, how
portable it is. Canvas does not have it. Only FormCanvas has it:
frameAndFillRoundRect: aRectangle radius: cornerRadius fillStyle: fillStyle
borderWidth: bw borderColor: bc
frameRoundRect: aRectangle radius: radius width: borderWidth color:
borderColor
fillRoundRect: aRectangle radius: radius fillStyle: fillStyle
At the moment, PluggableButtons round their corners _without_ the
CornerRounder but by using the canvas interface to draw rounded rectangles.
Is performance an issue? Well, the corner rounder is quite hacky...
Best,
Marcel
P.S.: The anti-aliasing trick works like this and may be slow:
aCanvas
frameRoundRect: self bounds
radius: 7
width: self borderWidth
color: (self borderColor alpha: 0.5).
aCanvas
frameAndFillRoundRect: self bounds
radius: 8
fillStyle: self fillStyle
borderWidth: self borderWidth
borderColor: self borderColor.
aCanvas
frameRoundRect: self bounds
radius: 9
width: self borderWidth
color: (self borderColor alpha: 0.3)
--
View this message in context: http://forum.world.st/Speaking-of-rounded-corners-tp4807342.html
Sent from the Squeak - Dev mailing list archive at Nabble.com.
More information about the Squeak-dev
mailing list
|