Permalink
Browse files

Merge branch 'MDL-60123-32' of https://github.com/snake/moodle into M…

…OODLE_32_STABLE
  • Loading branch information...
dmonllao committed Oct 20, 2017
2 parents 81b900a + cdd8360 commit 1b0d340042a66a5182dfbd28e547ea8950c5e5e0
@@ -3241,6 +3241,14 @@ EDITOR.prototype = {
*/
currentannotation: null,
/**
* Track the previous annotation so we can remove selection highlights.
* @property lastannotation
* @type M.assignfeedback_editpdf.annotation
* @protected
*/
lastannotation: null,
/**
* Last selected annotation tool
* @property lastannotationtool
@@ -3871,8 +3879,7 @@ EDITOR.prototype = {
scrollleft = canvas.get('docScrollX'),
point = {x: e.clientX - offset[0] + scrollleft,
y: e.clientY - offset[1] + scrolltop},
selected = false,
lastannotation;
selected = false;
// Ignore right mouse click.
if (e.button === 3) {
@@ -3904,20 +3911,29 @@ EDITOR.prototype = {
});
if (selected) {
lastannotation = this.currentannotation;
this.lastannotation = this.currentannotation;
this.currentannotation = selected;
if (lastannotation && lastannotation !== selected) {
if (this.lastannotation && this.lastannotation !== selected) {
// Redraw the last selected annotation to remove the highlight.
if (lastannotation.drawable) {
lastannotation.drawable.erase();
this.drawables.push(lastannotation.draw());
if (this.lastannotation.drawable) {
this.lastannotation.drawable.erase();
this.drawables.push(this.lastannotation.draw());
}
}
// Redraw the newly selected annotation to show the highlight.
if (this.currentannotation.drawable) {
this.currentannotation.drawable.erase();
}
this.drawables.push(this.currentannotation.draw());
} else {
this.lastannotation = this.currentannotation;
this.currentannotation = null;
// Redraw the last selected annotation to remove the highlight.
if (this.lastannotation && this.lastannotation.drawable) {
this.lastannotation.drawable.erase();
this.drawables.push(this.lastannotation.draw());
}
}
}
if (this.currentannotation) {
Oops, something went wrong.

0 comments on commit 1b0d340

Please sign in to comment.