summaryrefslogtreecommitdiff
path: root/vec2ddes.bmx
diff options
context:
space:
mode:
authorIan C <ianc@noddybox.co.uk>2005-10-21 01:17:03 +0000
committerIan C <ianc@noddybox.co.uk>2005-10-21 01:17:03 +0000
commitaf2a9b47a3d44b0980567f16f741ed28b049a3d6 (patch)
tree96270e0fdc94b26b92c71e220a0ab13cc7ff50e9 /vec2ddes.bmx
parent4b56bec7778e8f62c26ecad35bd07b49885c9b4b (diff)
Fixed line modes (broken by last two checkins)
Diffstat (limited to 'vec2ddes.bmx')
-rw-r--r--vec2ddes.bmx32
1 files changed, 19 insertions, 13 deletions
diff --git a/vec2ddes.bmx b/vec2ddes.bmx
index 7b9da83..f0c2780 100644
--- a/vec2ddes.bmx
+++ b/vec2ddes.bmx
@@ -480,6 +480,7 @@ Function DoDesigner(loadfile:String)
Const DRAG_MULTI:Int=2
Local sel:TDesObj=Null
+ Local line_sel:TDesPoint=Null
Local drag:Int=DRAG_NONE
Local sellist:TList=CreateList()
Local mode:Int=NORMAL_MODE
@@ -545,25 +546,28 @@ Function DoDesigner(loadfile:String)
Select mode
Case LINE_MODE
+ sellist.Clear()
+ sellist.AddLast(sel)
If IsPoint(sel)
- If sellist.Count()=0
- sellist.AddLast(sel)
+ If line_sel=Null
+ line_sel=TDesPoint(sel)
Else
- If sel<>sellist.ValueAtIndex(0)
+ If sel<>line_sel
mode=NORMAL_MODE
- Designer.obj.AddLast(TDesLine.Create(TDesPoint(sellist.ValueAtIndex(0)),TDesPoint(sel)))
- sellist.Clear()
+ Designer.obj.AddLast(TDesLine.Create(line_sel,TDesPoint(sel)))
EndIf
EndIf
EndIf
Case LINE_TO_LINE_MODE
+ sellist.Clear()
+ sellist.AddLast(sel)
If IsPoint(sel)
- If sellist.Count()=0
- sellist.AddLast(sel)
+ If line_sel=Null
+ line_sel=TDesPoint(sel)
Else
- If sel<>sellist.ValueAtIndex(0)
- Designer.obj.AddLast(TDesLine.Create(TDesPoint(sellist.ValueAtIndex(0)),TDesPoint(sel)))
- sellist.Clear()
+ If sel<>line_sel
+ Designer.obj.AddLast(TDesLine.Create(line_sel,TDesPoint(sel)))
+ line_sel=TDesPoint(sel)
EndIf
EndIf
EndIf
@@ -578,7 +582,7 @@ Function DoDesigner(loadfile:String)
EndIf
End Select
Else
- If Not KeyDown(KEY_LSHIFT) And Not KeyDown(KEY_RSHIFT)
+ If mode<>NORMAL_MODE Or (Not KeyDown(KEY_LSHIFT) And Not KeyDown(KEY_RSHIFT))
sellist.Clear()
EndIf
EndIf
@@ -659,6 +663,7 @@ Function DoDesigner(loadfile:String)
Case 1
sellist.Clear()
sel=Null
+ line_sel=Null
mode=LINE_MODE
Case 2
sellist.Clear()
@@ -671,6 +676,7 @@ Function DoDesigner(loadfile:String)
Case 4
sellist.Clear()
sel=Null
+ line_sel=Null
mode=LINE_TO_LINE_MODE
End Select
EndIf
@@ -705,7 +711,7 @@ Function DoDesigner(loadfile:String)
EndIf
Case LINE_MODE
- If sellist.Count()=0
+ If line_sel=Null
Tip("Move to first point")
Else
Tip("Move to second point")
@@ -727,7 +733,7 @@ Function DoDesigner(loadfile:String)
EndIf
Case LINE_TO_LINE_MODE
- If sellist.Count()=0
+ If line_sel=Null
Tip("Move to first point")
Else
Tip("Move to next point")