nhn / tui.image-editor

🍞🎨 Full-featured photo image editor using canvas. It is really easy, and it comes with great filters.
http://ui.toast.com/tui-image-editor
MIT License
6.98k stars 1.29k forks source link

Having Difficulty in sizing ImageObject using API #741

Open k-min9 opened 2 years ago

k-min9 commented 2 years ago

Hello, I'm using react for my project

this is my first addImageObject API

code

const editorAddImage = () => {editorRef.current.getInstance().addImageObject(logoImg);}

and following is the result 111

and I want to change the size of added ImageObject (I wanted to resize it to fit the canvas.) So, I wrote code like this

const editorAddImage = () => {
  editorRef.current.getInstance().addImageObject(logoImg)
  .then(res => {
    const editorInstance = editorRef.current.getInstance();
    var canvasSize = editorInstance.getCanvasSize();
    editorInstance.setObjectProperties(res.id, {width:canvasSize.width, height:canvasSize.height - 10} 
  )}
);}

I wanted to be like this

333

and this is the result

222

am I using wrong API??

lja1018 commented 2 years ago

@k-min9 It's like a bug. I'll try to fix it. Thank you for your information.

outNapGnaw commented 1 year ago

still now?