I am having some trouble accurately drawing polygons using Morphic and the various Canvas types.
My task is to recreate the Mac OS Platinum style buttons, and do be as pixel-accurate as I can. For the basic button, this involves creating a rectangle whose corners are always fattened by 2px on each side, no matter the extent of the underlying morph:
I can achieve this kind of outline when drawing individual lines one at a time with a Canvas:
Which gives me:
But using the native Polygon drawing features of Canvas yield a different, and incorrect, result:
Either this is some kind of limitation in BalloonCanvas/BalloonEngine (which "becomes" the canvas for polygon draw operations) or I am doing something terribly wrong.
Ideally I can trace this shape as a border, since I'll need to trace yet more additional borders around it (like the "default" button in Platinum, which has a fat complex border).
Borders are already kind of complicated, so any help you all can provide would be much appreciated.
FYI this same behavior is present in Squeak.
Combining this with a Complex border to create that button with different colors for left-up/right-bottom edges is maybe more difficult.
Hi Eric,I don't know exactly how Borders (BorderdMorphs) are drawn, but a simple way to create that kind of 1px border with 2px round edges may be using the a borderd morph:
fillStyle: Color transparent;
baseColor: Color red)
2018-05-16 20:48 GMT+02:00 Eric Gade <[hidden email]>:
|Free forum by Nabble||Edit this page|