strokes are now parented to whiteboard surface

This commit is contained in:
ericrius1 2016-02-26 15:07:22 -08:00
parent d0752143dc
commit 5762c33cfe

View file

@ -107,7 +107,9 @@
_this.resetStroke(); _this.resetStroke();
} }
} else { } else {
_this.resetStroke(); if (_this.currentStroke) {
_this.resetStroke();
}
Overlays.editOverlay(_this.laserPointer, { Overlays.editOverlay(_this.laserPointer, {
visible: false visible: false
@ -130,7 +132,6 @@
textures: _this.MARKER_TEXTURE_URL, textures: _this.MARKER_TEXTURE_URL,
color: _this.markerColor, color: _this.markerColor,
lifetime: 500, lifetime: 500,
// parentID: _this.currentWhiteboard
}); });
_this.linePoints = []; _this.linePoints = [];
@ -174,13 +175,20 @@
}); });
if (_this.linePoints.length > MAX_POINTS_PER_STROKE) { if (_this.linePoints.length > MAX_POINTS_PER_STROKE) {
Entities.editEntity(_this.currentStroke, {
parentID: _this.currentWhiteboard
});
_this.currentStroke = null; _this.currentStroke = null;
_this.oldPosition = position; _this.oldPosition = position;
} }
}, },
resetStroke: function() { resetStroke: function() {
Entities.editEntity(_this.currentStroke, {
parentID: _this.currentWhiteboard
});
_this.currentStroke = null; _this.currentStroke = null;
_this.oldPosition = null; _this.oldPosition = null;
}, },