Remove concept of instantiation from OnCanvasTextBox

main
Isaiah Odhner 2019-11-01 19:01:28 -04:00
parent 13fa15e7a9
commit 0891b8748f
2 changed files with 5 additions and 7 deletions

View File

@ -25,12 +25,8 @@ class OnCanvasTextBox extends OnCanvasObject {
};
update();
$G.on("option-changed", this._on_option_changed = update);
}
position() {
super.position(true);
}
instantiate() {
this.$el.addClass("instantiated").css({
this.$el.css({
cursor: make_css_cursor("move", [8, 8], "move")
});
this.$el.attr("touch-action", "none");
@ -97,6 +93,9 @@ class OnCanvasTextBox extends OnCanvasObject {
}
$fb.applyBounds();
}
position() {
super.position(true);
}
draw() {
const text = this.$editor.val();
if (text) {

View File

@ -580,7 +580,6 @@ tools = [{
pointerup: function(){
if (this.rect_width > 1 && this.rect_height > 1) {
textbox = new OnCanvasTextBox(this.rect_x, this.rect_y, this.rect_width, this.rect_height);
textbox.instantiate();
}
delete this.rect_x;