<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
<title></title>
</head>
<body bgcolor="#ffffff" text="#000000">
Hi Hilaire,<br>
<br>
Several days ago I told I'd be working on a replacement for that
VectorGraphicsPasteUpMorph hack I'd done.<br>
<br>
I have some experimental stuff working. The strategy is to use a
subclass of BitBltCanvas called HybridCanvas, that holds a
VectorCanvas in an instance variable. This means that vector
graphics morphs can be added to the world just like regular morphs.
I had to do many changes to the way that damage regions are handled,
etc. It is kind of working, but not without some hiccups, and maybe
I'd change things again. So, this is not yet ready for integration.<br>
<br>
The code is attached. To test this you'll need a bit of patience. It
includes 25 files! Also, it works reasonably well (without a
VectorGraphics plugin!) in a rather fast machine. A slow machine
might make it unusable. The procedure is:<br>
- Pull repos<br>
- Start Cuis. Don’t use an image you care about!<br>
- Install Updates<br>
- Feature require: 'VectorGraphics'<br>
- Open FileList on VGExperiments. Sort by name. Install each of the
25 files, in name order.<br>
- Close all windows.<br>
- Open a Workspace.<br>
- evaluate each of the following lines<br>
self runningWorld setCanvas: (HybridCanvas onForm: Display). "set
hybrid canvas"<br>
self runningWorld canvas class. "validate canvas updated"<br>
<br>
a _ EllipseMorph2 new openInWorld.<br>
b _ EllipseMorph3 new.<br>
c _ EllipseMorph4 new.<br>
a addMorph: b.<br>
b morphPosition: 100@0.<br>
a addMorph: c.<br>
c morphPosition: -100@0.<br>
<br>
Then you can do stuff like<br>
c stopStepping<br>
c startStepping<br>
<br>
Try the halo grow handle, etc.<br>
<br>
Browse a bit the new EllipseMorph classes. These new classes _only_
now how to draw themselves. They don't include #morphContainsPoint:
or #morphBoundsInWorld logic at all. Also check that the moment you
modify the #drawOn: method, everything works as expected. The idea
is to make writing new morphs as simple as possible, with the
framework handling the complex parts.<br>
<br>
I plan to keep working on this, until it is mature enough for
integration in Cuis.<br>
<br>
Thanks,<br>
<br>
On 7/8/2020 10:42 AM, Juan Vuletich via Cuis-dev wrote:
<blockquote cite="mid:5F05CD48.6030800@jvuletich.org" type="cite">
<meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
On 7/4/2020 5:46 PM, Hilaire Fernandes via Cuis-dev wrote:
<blockquote
cite="mid:72ef517f-7bf8-d77e-6a72-eda16b04582e@drgeo.eu"
type="cite">
<pre><font size="+1"><font color="#863266">containsPoint: aPoint
(super containsPoint: aPoint) ifFalse: [^ false].
(closed and: [color isTransparent not]) ifTrue:
[ ^ (self filledForm pixelValueAt: aPoint - bounds topLeft + 1) > 0].
self lineSegmentsDo:
[ :p1 :p2 |
(aPoint onLineFrom: p1 to: p2 within: (3 max: borderWidth+1//2) asFloat)
ifTrue: [^ true]].
self arrowForms do:
[ :f | (f pixelValueAt: aPoint - f offset) > 0 ifTrue: [^ true]].
^ false</font></font></pre>
</blockquote>
<br>
Hi Hilaire,<br>
<br>
The first thing to mention is that PolygonMorph should not inherit
from RectangleLikeMorph. PolygonMorph is more like M3Exp01Morph,
M3Exp02Morph and M3Exp03Morph. But these also don't work well yet.
Damage areas are not reported correctly and morphContainsPoint:
doesn't work either.<br>
<br>
The VectorGraphicsPasteUpMorph was just a hack to let you play
with vector graphics drawing, but I guess it is time to clean it
up, make it usable, and integrate it. Then it will make sense to
start building things like PolygonMorph in a clean style.<br>
<br>
Please give me a few days to work on this.<br>
<br>
Cheers,<br>
<pre class="moz-signature" cols="72">--
Juan Vuletich
<a moz-do-not-send="true" class="moz-txt-link-abbreviated" href="http://www.cuis-smalltalk.org">www.cuis-smalltalk.org</a>
<a moz-do-not-send="true" class="moz-txt-link-freetext" href="https://github.com/Cuis-Smalltalk/Cuis-Smalltalk-Dev">https://github.com/Cuis-Smalltalk/Cuis-Smalltalk-Dev</a>
<a moz-do-not-send="true" class="moz-txt-link-freetext" href="https://github.com/jvuletich">https://github.com/jvuletich</a>
<a moz-do-not-send="true" class="moz-txt-link-freetext" href="https://www.linkedin.com/in/juan-vuletich-75611b3">https://www.linkedin.com/in/juan-vuletich-75611b3</a>
@JuanVuletich</pre>
</blockquote>
<br>
<br>
<pre class="moz-signature" cols="72">--
Juan Vuletich
<a class="moz-txt-link-abbreviated" href="http://www.cuis-smalltalk.org">www.cuis-smalltalk.org</a>
<a class="moz-txt-link-freetext" href="https://github.com/Cuis-Smalltalk/Cuis-Smalltalk-Dev">https://github.com/Cuis-Smalltalk/Cuis-Smalltalk-Dev</a>
<a class="moz-txt-link-freetext" href="https://github.com/jvuletich">https://github.com/jvuletich</a>
<a class="moz-txt-link-freetext" href="https://www.linkedin.com/in/juan-vuletich-75611b3">https://www.linkedin.com/in/juan-vuletich-75611b3</a>
@JuanVuletich</pre>
</body>
</html>