Skip to content

Commit d632cc9

Browse files
committed
Tweaking the parabola example source; the random positioning would occasionally throw up positions that were unsuitable for presenting the code
1 parent ce4c7de commit d632cc9

File tree

2 files changed

+16
-14
lines changed

2 files changed

+16
-14
lines changed

src/examples/ParabolaFromLineAndVertex.as

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -39,18 +39,18 @@ package examples
3939

4040
a = new UIVertex(_context, vertexPaint);
4141
dragMechanism.apply(a);
42-
a.x = Math.random() * stage.stageWidth;
43-
a.y = Math.random() * stage.stageHeight;
42+
a.x = 120;
43+
a.y = 300;
4444

4545
b = new UIVertex(_context, vertexPaint);
4646
dragMechanism.apply(b);
47-
b.x = Math.random() * stage.stageWidth;
48-
b.y = Math.random() * stage.stageHeight;
47+
b.x = 400;
48+
b.y = 400;
4949

5050
c = new UIVertex(_context, vertexPaint);
5151
dragMechanism.apply(c);
52-
c.x = Math.random() * stage.stageWidth;
53-
c.y = Math.random() * stage.stageHeight;
52+
c.x = 300;
53+
c.y = 250;
5454

5555
line = new MutableLine(_context, a, b);
5656
lineDrawer = new LineDrawer(_context, line);

src/examples/ParabolaFromSegmentAndVertex.as

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ package examples
1313
import ui.interactive.DragMechanism;
1414
import ui.paint.SolidPaint;
1515

16-
[SWF(backgroundColor="#FFFFFF", frameRate="31", width="800", height="600")]
16+
[SWF(backgroundColor="#FFFFFF", frameRate="31", width="640", height="480")]
1717
public class ParabolaFromSegmentAndVertex extends ExampleBaseSprite
1818
{
1919
private var vertexPaint:SolidPaint;
@@ -40,18 +40,18 @@ package examples
4040

4141
a = new UIVertex(_context, vertexPaint);
4242
dragMechanism.apply(a);
43-
a.x = Math.random() * stage.stageWidth;
44-
a.y = Math.random() * stage.stageHeight;
43+
a.x = 120;
44+
a.y = 300;
4545

4646
b = new UIVertex(_context, vertexPaint);
4747
dragMechanism.apply(b);
48-
b.x = Math.random() * stage.stageWidth;
49-
b.y = Math.random() * stage.stageHeight;
48+
b.x = 400;
49+
b.y = 400;
5050

5151
c = new UIVertex(_context, vertexPaint);
5252
dragMechanism.apply(c);
53-
c.x = Math.random() * stage.stageWidth;
54-
c.y = Math.random() * stage.stageHeight;
53+
c.x = 300;
54+
c.y = 250;
5555

5656
line = new MutableLine(_context, a, b, LineType.SEGMENT);
5757
lineDrawer = new LineDrawer(_context, line);
@@ -62,7 +62,9 @@ package examples
6262
addChild(lineDrawer);
6363
addChild(parabolaDrawer);
6464

65-
addChild(a);addChild(b);addChild(c);
65+
addChild(a);
66+
addChild(b);
67+
addChild(c);
6668
}
6769
}
6870
}

0 commit comments

Comments
 (0)