Status: New
Owner: ----
Labels: Type-Defect Priority-Medium
New issue 903 by benjamin...(a)gmail.com: ROEdge without ROLine locks the
image
http://code.google.com/p/moose-technology/issues/detail?id=903
I have isolated the problem with the image locking up when ROEdge is used
without ROLine. I noticed that problem occurred also when using
ROAbstractLine instead of ROLine. So hacking breakpoints & logging into
the four methods of ROLine lead me to these being called on from ROEdge on
instance variable 'shape'. Looking at references of 'shape', I notice
that
ROEdge adds three methods that RONullShape does not have. So the image can
be prevented from locking up with the following ugly hack...
ROEdge>>contains: aPoint
(shape isKindOf: RONullShape) ifTrue: [ ^false].
^ shape contains: aPoint for: self
ROEdge>>topLeft
(shape isKindOf: RONullShape) ifTrue: [ ^ 0@0 ].
^ (shape lineSegmentsFor: self) first
I'll leave it there for Alexandre to come up with a more appropriate fix.
cheers -ben
Ben Coman wrote:
I can reproduce this on Windows 7 in Moose-4.7-beta
from 2012-01-03
(ConfigurationOfRoassal.A...B...752)
With the ROLine commented as shown below the image locks. Alt-. fails to
interrupt.
With the ROLine uncommented it works fine.
Forgetting ROLine is likely a common occurance for
people new to Roassal,
so
this makes it a bit fragile.
---
| view node1 node2 edge |
view := ROView new.
node1 := ROLabel elementOn: 'node1'.
node2 := ROLabel elementOn: 'node2'.
edge := (ROEdge from: node1 to: node2) "+ ROLine" .
view add: node1; add: node2; add: edge.
view open
---
cheers -ben
Alexandre Bergel wrote:
Hi Yuriy!
I guess you meant "view add: edge; add: node1; add: node2." instead of
using "rawView".
The script does not freeze the VM I use (Croquet
Cog 4.0.2636 and the
one contained in the Pharo 1.4 one click).
In fact, having an edge without line is perfectly
okay. No error is
raised and none should be raised. The line is simply invisible.
Strange
that you got this error.
Anyone can reproduce this error?
Cheers,
Alexandre
On Jan 25, 2013, at 10:37 AM, Yuriy Tymchuk <yuriy.tymchuk(a)me.com>
wrote:
> Hi.
>
> When edges are initialized without lines, VM freezes.
>
> For instance when I run next code:
>
> | view node1 node2 edge |
> view := ROView new.
> node1 := ROLabel elementOn: 'node1'.
> node2 := ROLabel elementOn: 'node2'.
> node1 @ RODraggable.
> node2 @ RODraggable.
> edge := ROEdge from: node1 to: node2.
> rawView add: edge; add: node1; add: node2.
> ROHorizontalLineLayout on: (Array with: node1 with: node2).
> view open
>
>
> I know that you should do something like
>
> edge + (ROLine red).
>
> But Roasal shouldnt freeze the VM anyway :)
>
>
>
> --
> View this message in context:
http://moose-dev.97923.n3.nabble.com/Roasal-freezing-VM-tp4025992.html
>> Sent from the moose-dev mailing list archive at
Nabble.com.
>> _______________________________________________
>> Moose-dev mailing list
>> Moose-dev(a)iam.unibe.ch
>>
https://www.iam.unibe.ch/mailman/listinfo/moose-dev
>>
>
>