pan background image to canvas dimensions #6921
Unanswered
zipporaSay
asked this question in
Q&A
Replies: 1 comment
-
i solved it |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
i create a canvas it's include background image with objects on it.
i set the image to backgrond by scale,
and i have to cut the image in sides according to scale to put the image in canvas's center .
setBackgroundImage(bgImage, () => {},{
top: top, // -121 for exp.
left: left, // 0 for exp.
originX: 'left',
originY: 'top',
scaleX: canvasScale,
scaleY: canvasScale,
objectCaching: false,
canvas: this.canvasDefenitions.canvas
});
now i want to drag the image to edges to see all sides and corners of image,
but image have to keep fit to canvas.
i drag the image by change the viewport like in documentation.
the backgrond drag ok and all the objects also
but seemed the viewport not effect the background image entirely.
in the example:
top = -121
i let viewport[5] to be from 121 to -242 to display all - this is the right range
but the image not save fit to canvas edges when it went up,
hope your help
thanks
Beta Was this translation helpful? Give feedback.
All reactions