DrGCirlceItem>>intersectionWith:flag: needs clarification
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Dr. Geo |
Invalid
|
Undecided
|
Unassigned |
Bug Description
The following method implements the distinction of different cases.
Thus parameter aCurveItem actually may be any item, not only a curveItem.
The code should show this. In addition the call to this code is protected by
on: Error do: [nil]
It was difficult to spot an error here.
OLD
----
DrGCircleItem>>
intersectionWith: aCurveItem flag: aFlag
|aPoint|
aCurveItem isLineItem
ifTrue: [^self intersectionWit
(aCurveItem isSegmentItem or: [aCurveItem isRayItem])
ifTrue:
[aPoint := self intersectionWit
aPoint ifNil: [^nil].
(aCurveItem contains: aPoint)
ifTrue: [^aPoint]
ifFalse: [^nil]].
aCurveItem isCircleItem
ifTrue: [^self intersectionWit
aCurveItem isArcItem
ifTrue: [^aCurveItem intersectionWith: self flag: aFlag]
New
---
intersectionWith: anItem flag: aFlag
|aPoint|
anItem isLineItem
ifTrue: [^self intersectionWit
(anItem isSegmentItem or: [anItem isRayItem])
ifTrue:
[aPoint := self intersectionWit
aPoint ifNil: [^nil].
(anItem contains: aPoint)
ifTrue: [^aPoint]
ifFalse: [^nil]].
anItem isCircleItem
ifTrue: [^self intersectionWit
anItem isArcItem
ifTrue: [^anItem intersectionWith: self flag: aFlag]
Changed in drgeo: | |
milestone: | none → 19.03 |
Changed in drgeo: | |
status: | Triaged → Invalid |
As far as I can see, the argument aCurveItem belongs to this categories of items (2 dimensions).
I suggest you add at the beginning of the method:
Transcript show: aCurveItem ;cr.
Or do you mean something else?