Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/dots-error'
Browse files Browse the repository at this point in the history
  • Loading branch information
DipanshKhandelwal committed Dec 29, 2017
2 parents fb012f9 + 9d8c74b commit 4e9c16f
Showing 1 changed file with 10 additions and 22 deletions.
32 changes: 10 additions & 22 deletions js/activity.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ define(function (require) {
var Star = "images/star.svg";
var Dot = "images/dot.svg";
var Pen = "images/pen.svg";
var shape = -1;
var shape = 0;
// Get things started
init();

Expand Down Expand Up @@ -96,7 +96,6 @@ define(function (require) {
// Create a drawing canvas
drawingCanvas = new createjs.Shape();
stage.addChild(drawingCanvas);
new_positions();
stage.update();
}

Expand Down Expand Up @@ -225,37 +224,26 @@ define(function (require) {
}

function new_positions() {
if (shape == -1) {
shape = 0;
return;
}
for (i = 0; i < bitmaps.length; i++) {
var fontSize = 6;
var ovrhdX = i.toString().length * fontSize;
var ovrhdY = fontSize + 4;
if (shape < shapes.length) {
if (i < shapes[shape].length) {
var shapeX = shapes[shape][i][0];
var shapeY = shapes[shape][i][1];
var fontSize = 6;
var ovrhdX = i.toString().length * fontSize;
var ovrhdY = fontSize + 4;
bitmaps[i].x = shapeX;
bitmaps[i].y = shapeY;
bitmapLabels[i].x = shapeX - ovrhdX;
bitmapLabels[i].y = shapeY - ovrhdY;
bitmaps[i].x = shapes[shape][i][0];
bitmaps[i].y = shapes[shape][i][1];
}
else {
var outRange = -100;
bitmaps[i].x = outRange;
bitmaps[i].y = outRange;
bitmapLabels[i].x = outRange;
bitmapLabels[i].y = outRange;
bitmaps[i].x = -100;
bitmaps[i].y = -100;
}
}
else {
bitmaps[i].x = canvas.width * Math.random() | 0;
bitmaps[i].y = canvas.height * Math.random() | 0;
bitmapLabels[i].x = canvas.width * Math.random() | 0;
bitmapLabels[i].y = canvas.height * Math.random() | 0;
}
bitmapLabels[i].x = bitmaps[i].x - ovrhdX;
bitmapLabels[i].y = bitmaps[i].y - ovrhdY;
}
pen_bitmap.x = bitmaps[0].x;
pen_bitmap.y = bitmaps[0].y;
Expand Down

0 comments on commit 4e9c16f

Please sign in to comment.