ajstarks / giocanvas

Canvas API built with Gio
Other
141 stars 15 forks source link

Failing to compile with latest gioui version - nov 25 #7

Closed hlima closed 3 years ago

ajstarks commented 3 years ago

yes, I plan to work on that soon.

ajstarks commented 3 years ago

Progress: now builds with the latest gioui, but images are broken.

ajstarks commented 3 years ago

Images fixed.

hlima commented 3 years ago

working great again. Thanks

hlima commented 3 years ago

unfortunately image is not behaving properly ... The positioning does not seem to be correct nor the size..

ajstarks commented 3 years ago

@hlima can you show the code that is not working?

(see https://github.com/ajstarks/giocanvas/blob/20b2b6e216715bf385fc030bf7930fca18d98e4f/play/main.go#L135

for example use

hlima commented 3 years ago

canvas.CenterImage("earth.jpg", 50, 50, int(canvas.Width*0.06), int(canvas.Height*0.09), 100) The code I am using is similar to the above. This should draw the image in the canvas center and have it proportionally resized. It is slightly off center and the resize does not seem to work.

ajstarks commented 3 years ago

I see, suggestion: use the natural width, and height, and resize via the scale.

hlima commented 3 years ago

using scale seems to solve the resizing. thanks. Position is still not working. seems to be better when the canvas size is increased. may be it is a rounding error?

ajstarks commented 3 years ago

See: https://github.com/ajstarks/giocanvas/tree/master/images images