Skip to content

Instantly share code, notes, and snippets.

@migerh
Last active December 18, 2015 00:29
Show Gist options
  • Save migerh/5696810 to your computer and use it in GitHub Desktop.
Save migerh/5696810 to your computer and use it in GitHub Desktop.
Patch for JXG.Curve.updateRenderer()
JXG.Curve.prototype.updateRenderer = function () {
var wasReal;
if (this.needsUpdate && this.visProp.visible) {
wasReal = this.isReal;
if (this.isReal) {
this.board.renderer.updateCurve(this);
}
this.checkReal();
if (this.isReal) {
if (wasReal !== this.isReal) {
this.board.renderer.show(this);
if (this.hasLabel && this.label.content.visProp.visible) {
this.board.renderer.show(this.label.content);
}
}
} else {
if (wasReal !== this.isReal) {
this.board.renderer.hide(this);
if (this.hasLabel && this.label.visProp.visible) {
this.board.renderer.hide(this.label);
}
}
}
// Update the label if visible.
if (this.hasLabel && this.label.visProp.visible) {
this.label.update();
this.board.renderer.updateText(this.label);
}
}
return this;
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment