Clear preview when all points have been ‘oopsed’ away, fixes https://github.com/Doodle3D/doodle3d-client/issues/123.
This commit is contained in:
Wouter R 2013-12-11 22:21:05 +01:00
parent 076b69500e
commit aa585236b8
2 changed files with 6 additions and 3 deletions

View File

@ -83,7 +83,10 @@ var debug_redrawSimplification = 6;
function redrawPreview(redrawLess) {
if (redrawLess == undefined) redrawLess = false;
if (_points.length < 2) return;
if (_points.length < 2) {
previewCtx.clearRect(0, 0, preview.width, preview.height);
return;
}
if (!redrawLess) {
//debug_redrawSimplification = Math.round(_points.length / 65);
@ -345,4 +348,4 @@ function updatePreview(_x, _y, redrawLess) {
updatePrevY = _y;
}
//*/
//*/

View File

@ -54,7 +54,7 @@ function setCurrentSketchId(sId) {
}
function updatePrevNextButtonStateOnClear() {
enableButton(btnPrevious, prevDoodle);
if (numSavedSketches > 0) enableButton(btnPrevious, prevDoodle);
disableButton(btnNext);
currentSketchId = numSavedSketches+1; //after the end of the list
disableButton(btnSave);