From e4be214c1f82d194f45b54f630b132352e1ddfd1 Mon Sep 17 00:00:00 2001 From: Devine Lu Linvega Date: Sun, 25 Dec 2016 21:03:51 -0700 Subject: [PATCH] Trying to fix issues with layer.move --- scripts/modules/surface.layer.js | 6 ++++-- scripts/modules/typographe.js | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/scripts/modules/surface.layer.js b/scripts/modules/surface.layer.js index 97a771b..dd019fa 100644 --- a/scripts/modules/surface.layer.js +++ b/scripts/modules/surface.layer.js @@ -73,10 +73,12 @@ function Layer(name,host = "user") var offset_x = this.move_from.x - position.x; var offset_y = this.move_from.y - position.y; - + + var content = this.context().canvas; + this.context().globalCompositeOperation = "copy"; - this.context().drawImage(this.context().canvas, -offset_x, -offset_y); this.context().globalCompositeOperation = "source-over"; + this.context().drawImage(content,-offset_x,-offset_y,ronin.surface.size.width,ronin.surface.size.height); this.move_from = new Position(position.x,position.y); } diff --git a/scripts/modules/typographe.js b/scripts/modules/typographe.js index 4f0b0f8..0be2bdf 100644 --- a/scripts/modules/typographe.js +++ b/scripts/modules/typographe.js @@ -28,7 +28,7 @@ function Typographe(rune) var ctx = context; var text = cmd.variable("text").value; - var position = cmd.position() ? cmd.position() : new Position(10,10); + var position = cmd.position() ? cmd.position() : new Position(20,40); var color = cmd.color() ? cmd.color() : new Color("#000000"); var size = cmd.value() ? cmd.value().int : 20;