mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
Set canvas height and width for Firefox image copy-paste.
This commit is contained in:
parent
d25081ce07
commit
2e4a699b30
@ -385,8 +385,10 @@ Discourse.ComposerView = Discourse.View.extend(Ember.Evented, {
|
|||||||
var image = new Image();
|
var image = new Image();
|
||||||
image.onload = function() {
|
image.onload = function() {
|
||||||
// Create a new canvas.
|
// Create a new canvas.
|
||||||
var canvas = document.createElementNS('http://www.w3.org/1999/xhtml', 'canvas'),
|
var canvas = document.createElementNS('http://www.w3.org/1999/xhtml', 'canvas');
|
||||||
ctx = canvas.getContext('2d');
|
canvas.height = image.height;
|
||||||
|
canvas.width = image.width;
|
||||||
|
var ctx = canvas.getContext('2d');
|
||||||
ctx.drawImage(image, 0, 0);
|
ctx.drawImage(image, 0, 0);
|
||||||
|
|
||||||
canvas.toBlob(function(blob) {
|
canvas.toBlob(function(blob) {
|
||||||
|
Loading…
Reference in New Issue
Block a user