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; [hidden email]; http://www.rowledge.org/tim Strange OpCodes: BIB: Branch If Branch if branch... |
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 |
Free forum by Nabble | Edit this page |