[squeak-dev] Re: rounded corner morphs seem to be broken

marcel.taeumel Marcel.Taeumel at hpi.de
Tue Jun 28 07:43:37 UTC 2016


tim Rowledge wrote
> I’m trying to work out why the comment morphs in nuScratch are not getting
> the rounded corners that they should. This is something that changed a
> while ago without me really noticing. I think we’re talking late last year
> as best I can tell from trying out older releases to attempt to
> triangulate on the problem.
> 
> In the olden days we used a CornerRounder class to handle things, which
> has gone away. So far as I can work out now we don’t really do the job
> thoroughly. Individual morphs can draw with rounded corners ok although
> the rounding is not very nicely drawn below a radius of 8 pixels, which is
> admittedly not a huge surprise. If you make a composite morph - like the
> comment morphs - the submorphs are not affected at all any more. This
> makes the comment morph fairy very sad.
> 
> The comment fairy wants her morphs to look like this - 
> 
> and when the little magic triangle is tickled it should look like this -
> 
> 
> Instead we get this - 
> 
> and - 
> 
> 
> The comment is currently implemented as an AlignmentMorph containing a
> topbar (another alignment containing the triangle and a usually empty
> string morph) and the lower area holding a ‘MultilineStringMorph’ and the
> resize icon morph. The lower-right corner looks ok because the resize icon
> is small enough not to overlap the rounding. I managed improve things a
> little by making the background to the lower text transparent; before that
> the lower left corner was squared off too.
> 
> Looking around for rounding related code I note that the
> Morph>roundedCorners method which appears to be a way to designate which
> corners are actually rounded is no longer used. Which is a pity since it
> would possibly solve my problem by allowing me to round the top two
> corners of the upper alignment morph. Hmm, actually since the colours of
> the upper and lower backgrounds are very close it kinda-sorta looks
> acceptable if I just round the entire upper morph - but it ain’t proper I
> tell you!
> 
> Can anyone recall messing about with rounding morphs over the last year or
> thereabouts? I think it happened between 4.5-13860 and 4.6-15102
> 
> tim
> --
> tim Rowledge; 

> tim@

> ; http://www.rowledge.org/tim
> Strange OpCodes: BIB: Branch If Branch if branch...
> 
> 
> 
> 
> 
> 
> Screen Shot 2016-06-27 at 2.09.27 PM.png (6K)
> <http://forum.world.st/attachment/4903723/0/Screen%20Shot%202016-06-27%20at%202.09.27%20PM.png>
> Screen Shot 2016-06-27 at 2.10.21 PM.png (6K)
> <http://forum.world.st/attachment/4903723/1/Screen%20Shot%202016-06-27%20at%202.10.21%20PM.png>
> Screen Shot 2016-06-27 at 2.12.11 PM.png (5K)
> <http://forum.world.st/attachment/4903723/2/Screen%20Shot%202016-06-27%20at%202.12.11%20PM.png>
> Screen Shot 2016-06-27 at 2.12.39 PM.png (4K)
> <http://forum.world.st/attachment/4903723/3/Screen%20Shot%202016-06-27%20at%202.12.39%20PM.png>

Hi Tim,

rounded corners are implemented in a Morph's #drawOn: method. See Morph >>
#drawOn: for an example.

It was a refactoring that removed many low-level hacks and added the
possibility to configure the corner radius.

Your example reminds me of our UserDialogBoxMorph. If you want to only round
two of four corners, you have to draw an additional rectangle because there
is no call in our drawing engine that draws a "partially" rounded rectangle.
See UserDialogBoxMorph >> #drawSubmorphsOn:. You have do modify NuScratch
code.

Sorry for the inconvenience.

We could think about adding a new call to Canvas that does this.

Best,
Marcel



--
View this message in context: http://forum.world.st/rounded-corner-morphs-seem-to-be-broken-tp4903723p4903787.html
Sent from the Squeak - Dev mailing list archive at Nabble.com.


More information about the Squeak-dev mailing list