mirror of
https://github.com/codeninjasllc/discourse.git
synced 2024-11-23 23:58:31 -05:00
Merge pull request #2106 from vikhyat/firefox-paste-image
Set canvas height and width for Firefox image copy-paste
This commit is contained in:
commit
ad45fdaed7
1 changed files with 4 additions and 2 deletions
|
@ -385,8 +385,10 @@ Discourse.ComposerView = Discourse.View.extend(Ember.Evented, {
|
|||
var image = new Image();
|
||||
image.onload = function() {
|
||||
// Create a new canvas.
|
||||
var canvas = document.createElementNS('http://www.w3.org/1999/xhtml', 'canvas'),
|
||||
ctx = canvas.getContext('2d');
|
||||
var canvas = document.createElementNS('http://www.w3.org/1999/xhtml', 'canvas');
|
||||
canvas.height = image.height;
|
||||
canvas.width = image.width;
|
||||
var ctx = canvas.getContext('2d');
|
||||
ctx.drawImage(image, 0, 0);
|
||||
|
||||
canvas.toBlob(function(blob) {
|
||||
|
|
Loading…
Reference in a new issue