From 80d1b352167d1133a48f3b71d2a7adb9f85168e5 Mon Sep 17 00:00:00 2001 From: "john@roojs.com" Date: Wed, 2 Jan 2019 12:28:56 +0800 Subject: [PATCH] FIX: bezier signature -- draw image should after img.onload --- Roo/bootstrap/BezierSignature.js | 6 +++++- roojs-bootstrap-debug.js | 6 +++++- roojs-bootstrap.js | 4 ++-- 3 files changed, 12 insertions(+), 4 deletions(-) diff --git a/Roo/bootstrap/BezierSignature.js b/Roo/bootstrap/BezierSignature.js index 808e2c8f2b..3bbdd17b9d 100644 --- a/Roo/bootstrap/BezierSignature.js +++ b/Roo/bootstrap/BezierSignature.js @@ -416,9 +416,13 @@ Roo.extend(Roo.bootstrap.BezierSignature, Roo.bootstrap.Component, { { var img = new Image(); + img.onload = function(){ + this.canvasElCtx().drawImage(img, 0, 0); + }.bind(this); + img.src = img_src; - this.canvasElCtx().drawImage(img, 0, 0); + this.is_empty = false; }, // Bezier Point Constructor diff --git a/roojs-bootstrap-debug.js b/roojs-bootstrap-debug.js index 5422f3a407..4f56030627 100644 --- a/roojs-bootstrap-debug.js +++ b/roojs-bootstrap-debug.js @@ -41918,9 +41918,13 @@ Roo.extend(Roo.bootstrap.BezierSignature, Roo.bootstrap.Component, { { var img = new Image(); + img.onload = function(){ + this.canvasElCtx().drawImage(img, 0, 0); + }.bind(this); + img.src = img_src; - this.canvasElCtx().drawImage(img, 0, 0); + this.is_empty = false; }, // Bezier Point Constructor diff --git a/roojs-bootstrap.js b/roojs-bootstrap.js index 6665fa1e0f..a021590248 100644 --- a/roojs-bootstrap.js +++ b/roojs-bootstrap.js @@ -1749,8 +1749,8 @@ C.beginPath();this.drawCurveSegment(B.x,B.y,D);C.closePath();C.fillStyle=A;C.fil i