Open keanass opened 8 years ago
Which was the last version it worked for you?
1.3.2 and upper,shadow of the scaled objects is not taking the angle of rotation.
Probably #669, @inssein any ideas?
i tested all the versions no solution
i need just to calculate the ofsets x,y to rotate the shadow i have allready the angle, any idea
here is the solution for hwo want to export svg or png of canvas with rotated objects has shadow :
var pOffset = fabric.util.rotatePoint(new fabric.Point(object.shadow.offsetX, object.shadow.offsetY), new fabric.Point(0, 0), fabric.util.degreesToRadians(360-object.angle));
then you get the new offsets : pOffset .x and pOffset .y
Sorry I was on vacation. @keanass is there still a node-canvas bug? You mentioned that it happened on all versions of node-canvas.
Hi, I may have the same problem.
// in browser CanvasRenderingContext2D
ctx.shadowOffsetX = 0;
ctx.shadowOffsetY = 20;
ctx.drawImage(img,100,100);
// ctx.getTransform() = [0,1,-1,0,0,0]
// this ctx is rotate 90deg, and the shadow is just on bottom.
// in node canvas CanvasRenderingContext2D
ctx.shadowOffsetX = 0;
ctx.shadowOffsetY = 20;
ctx.drawImage(img,100,100);
// ctx.currentTransform = [0,1,-1,0,0,0]
// this ctx is rotate 90deg, but the shadow is just on left!!!
Why don't they draw the same?
Shadow is rendering inversed on latest version of canvas, any one know about this issue.