[Cuis-dev] VectorGraphics and Morph
Juan Vuletich
juan at jvuletich.org
Mon Jul 27 15:55:13 PDT 2020
On 7/27/2020 7:25 AM, Hilaire Fernandes via Cuis-dev wrote:
>
> I understood what happened, when the image is saved, the benefit of
> this execution is lost and should be executed again before operating
> anythings:
>
> self runningWorld setCanvas: (HybridCanvas onForm: Display).
>
> self runningWorld canvas class.
>
> Hilaire
>
> Le 23/07/2020 à 19:00, Hilaire Fernandes a écrit :
>>
>> Whne I save the image (I think with the Ellipse morph destroyed) then
>> start the image again I have this DNU on
>> EllipseMorph2>>morphContainsPoint:
>>
>> Btw, why can't I find the error log file?
>>
> --
> GNU Dr. Geo
> http://drgeo.eu
Hi Hilaire, Folks,
I've been working on a new implementation. It starts to work reasonably
well.
The HybridCanvas will choose automatically between BitBlt and
VectorCanvas depending on the morpt to be drawn. The RectangleLikeMorph
hierarchy will be drawn using BitBlt, unless rotated or scaled. Other
Morph classes will use VectorCanvas. Play, for example, with
EllipseMorph2 and EllipseMorph3.
The code is in 77 changesets. To make it easier for you to play with all
this, I prepared a couple of images.
Check
https://www.dropbox.com/s/lppb9a3k7q3t9qs/VectorGraphicsCoreUpdates.zip?dl=0
https://www.dropbox.com/s/cptwrfsu2bm36nn/VGExperimentsImage.zip?dl=0
https://www.dropbox.com/s/08fq770i6wi3eds/VGExperiments32Image.zip?dl=0
If you want to load the changesets, in a Cuis updated to #4253 do:
- Feature require: 'VectorGraphics'
- Load the changesets in order. Copying them to an CoreUpdates folder
and installing new updates should work.
- MorphicCanvas activeSubclass: HybridCanvas
- Set system font: DejaVu Sans
- World / New Morph… / EllipseMorph3, for example.
Try the "new" rotate / zoom handle (yes, I know. They should be 2
separate handles!). Browse the code. Check how simple a VG morph can be!
Check that you can grab the ellipse from any inner pixel, and no outside
pixel, even if the EllipseMorph3 class doesn't implement
#morphContainsPoint: or any other similar method. It also doesn't
include any method to tell the area it occupies on the Display, and
still updates and redraws work correctly. See what happens if you change
the code to make it bigger, for example, and the in an ispector do 'self
redrawNeeded', or just World / restore display. Check EllipseMorph2 that
includes stepping. In the class comment of one of those there are
several lines of code, that if evaluated together in a Workspace, will
stitch a few ellipses together and makes them step. Try it!
As usual, all this is experimental. It could break in unexpected ways, etc.
Feedback is most welcome.
Cheeers,
--
Juan Vuletich
www.cuis-smalltalk.org
https://github.com/Cuis-Smalltalk/Cuis-Smalltalk-Dev
https://github.com/jvuletich
https://www.linkedin.com/in/juan-vuletich-75611b3
@JuanVuletich
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.cuis.st/mailman/archives/cuis-dev/attachments/20200727/cec1b9d5/attachment.htm>
More information about the Cuis-dev
mailing list