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.
Nice!
-- View this message in context: http://forum.world.st/Speaking-of-rounded-corners-tp4807342p4807345.html Sent from the Squeak - Dev mailing list archive at Nabble.com.
Hi Marcel,
Take a look at #windowFrame:color:radius:border:labelHeight:gradientTop:gradientBottom:insideColor: in Cuis. Besides anti aliasing, it also does gradients.
CornerRounder was one of the first things I removed when started Cuis.
Cheers, Juan Vuletich
Quoting Marcel Taeumel marcel.taeumel@student.hpi.uni-potsdam.de:
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.
On 24.02.2015, at 09:02, Marcel Taeumel marcel.taeumel@student.hpi.uni-potsdam.de wrote:
I think that the CornerRounder is not appropriate. It's a hack like its class comment sais. ;-)
Indeed.
Is performance an issue?
It might be. Our window redraws are pretty slow anyway so it might not matter much, but then making it even slower may not be the best idea ;)
You also have to watch out for the different border styles a morph can have (OTOH the CornerRounder only handles borders up to 2 pixels wide anyway).
A related issue is that we should start to take advantage of higher-resolution displays without pixel-doubling. Squeak looks seriously outdated on a 200 dpi screen. Drawing things properly is a step in that direction.
- Bert -
Remove_Corner_Rounder.cs http://forum.world.st/file/n4807489/Remove_Corner_Rounder.cs
Could somebody please check the attached code? I want to commit it to trunk. As it affects several packages, I preferred to use a change set for now. :)
Preferences -> Morphic -> Preferred Corner Radius
Best, Marcel
-- View this message in context: http://forum.world.st/Speaking-of-rounded-corners-tp4807342p4807489.html Sent from the Squeak - Dev mailing list archive at Nabble.com.
On Wed, Feb 25, 2015 at 01:35:25AM -0800, Marcel Taeumel wrote:
Remove_Corner_Rounder.cs http://forum.world.st/file/n4807489/Remove_Corner_Rounder.cs
Could somebody please check the attached code? I want to commit it to trunk. As it affects several packages, I preferred to use a change set for now. :)
Preferences -> Morphic -> Preferred Corner Radius
I loaded the changes with no problem. It looks good to me.
The only minor concern would be that the preference for roundedWindowsCorners is in the "windows" preference category, and the new preference for Preferred Corner Radius is in category "Morphic". Should we have them grouped together in the same preference category?
Dave
I think we need multiple categories for that. Otherwise, I would move the "rounded windows" to "Morphic" because the corner radius affects all morphs, not just windows.
Best, Marcel
-- View this message in context: http://forum.world.st/Speaking-of-rounded-corners-tp4807342p4807758.html Sent from the Squeak - Dev mailing list archive at Nabble.com.
For me, it looks like the fill and the border don't align on the right and bottom side. Moving or resizing a window left some drawing artifacts.
2015-02-25 10:35 GMT+01:00 Marcel Taeumel < marcel.taeumel@student.hpi.uni-potsdam.de>:
Remove_Corner_Rounder.cs http://forum.world.st/file/n4807489/Remove_Corner_Rounder.cs
Could somebody please check the attached code? I want to commit it to trunk. As it affects several packages, I preferred to use a change set for now. :)
Preferences -> Morphic -> Preferred Corner Radius
Best, Marcel
-- View this message in context: http://forum.world.st/Speaking-of-rounded-corners-tp4807342p4807489.html Sent from the Squeak - Dev mailing list archive at Nabble.com.
Thank you! I missed to check the version with all gradients enabled. Seems to be buggy. I'll fix that! :)
Best, Marcel
-- View this message in context: http://forum.world.st/Speaking-of-rounded-corners-tp4807342p4807977.html Sent from the Squeak - Dev mailing list archive at Nabble.com.
squeak-dev@lists.squeakfoundation.org