Hi guys
with igor we sat and had a look at Roassal for a couple of minutes and here are a list of
points for real speed improvements.
Igor did not want to send them because he does not want to look like an asshole
criticizing but I think that if we want roassal to be really
a success we should.
Now are the mooser and roassalers really interested in making Roassal scalable? (I hope so
but I would respect otherwise and think for the future :)
because we (moosers) could ask for feedback to igor and Alex you could come to pair
program here with him around ESUG.
Stef
* Point 1: wasting cycles to do conversion
--------------------------------------------------------
ROPharoCanvas>>line: aPoint to: aPoint2 width: aSmallInteger color: aColor
nativeCanvas line: (self virtualToRealPoint: aPoint) to: (self virtualToRealPoint:
aPoint2) width: aSmallInteger color: aColor.
wasting cycles to convert from your local coordinate space into global one on every single
operation is not a good idea. Guess why :)
Athens provides the user-space coordinate system for geometry by default.. so that you
don't have to maintain it by yourself.
So if you want a real system these points should be addressed ;)
* Point 2: missing transformation matrix
-----------------------------------------------------
You don't even have a transformation as a concept.. and instead of simple and
straightforward affine matrix which people
learn in schools today: a Camera
virtualToRealPointNoTrunc: aPoint
"Return a virtual point from a one expressed in the real coordinates"
| visibleBounds offset |
visibleBounds := self bounds.
offset := self position.
^ ((aPoint x asFloat - offset x * realExtent x / visibleBounds width) asFloat) @
((aPoint y asFloat - offset y * realExtent y / visibleBounds height) asFloat)
ROAthensCanvas>>line: aPoint to: aPoint2 width: aSmallInteger color: aColor
| path |
path := nativeCanvas createPath: [:builder |
builder
absolute;
moveTo: (self virtualToRealPoint: aPoint);
lineTo: (self virtualToRealPoint: aPoint2).
].
(nativeCanvas setStrokePaint: aColor) width: aSmallInteger .
nativeCanvas drawShape: path
see this #virtualToRealPoint: calls?
Athens provides this for free. Do not do it the hard way: (do not transform poor vector
multiple times to get there.)
Athens do it for you using math:
(v * M1) * M2 = v * (M1*M2)
* Point 3 about design
------------------------------
ROAbstractArrow
ROArrow
ROReversedArrow
ROHorizontalArrow
ROReversedHorizontalArrow
ROVerticalArrow
ROReversedVerticalArrow
Why do we have all these classes? why they are not...