websanova/wPaint — pull request #38 by avernet (2013-06-07 22:22:05+00:00)
Title: Support max-width/max-height

We've added a "image annotation" control in Orbeon Forms (an open source web forms builder and server, see the [Orbeon Forms GitHub repo]), which uses wPaint. We just had one issue with wPaint, happening when the image being annotated is larger than the size of the canvas. We always set the canvas to be the size of the image, but make sure the canvas gets "scaled down" using CSS's `max-width` and `max-height`.

wPaint didn't handle this out-of-the-box, as it requires a little but of coordinate gymnastic, which luckily can be done in a pretty centralized way in wPaint (OK, OK… it's not luck, but good design in wPaint!).

If this makes sense for wPaint, it would be helpful if this could be integrated, so we can more easily upgrade to newer version in the future. Thanks!

[Orbeon Forms GitHub repo]: https://github.com/orbeon/orbeon-forms