Permalink
Browse files

Merge branch 'MDL-60123-master' of https://github.com/snake/moodle

  • Loading branch information...
dmonllao committed Oct 20, 2017
2 parents f04825d + 324debc commit 202221f934a02b333a84cfa6e790d093bed56882
@@ -3373,6 +3373,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
@@ -4145,8 +4153,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) {
@@ -4178,20 +4185,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 202221f

Please sign in to comment.