Rendering images from text buttons
June 14, 2016 12:00 AM
I'm trying to create a text button with a circle shape. Lectora will render the shape into an image during publication. The problem I'm having is that the shape, the circle, is positioned not at x:0 / y:0 but at x:1 / y:1 in the PNG, so 1px is cut off on the right and on the bottom making the button look slightly unround. Please move the shape 1px up and left in the PNG.
Thanks
Tim
Discussion (7)
Gotcha, definite bug. Effects both shapes and buttons. The border thing works on both as a work around until it's fixed.
Tim, until what seems like a bug is fixed, you can add a 1px border the same color as the background. That will eliminate the issue by hiding what is cut off. Why aren't you using a text button?
Thanks Tim. I created an issue in our bug tracking system for this problem and upped the priority to get one of the developers to look into it. If we have any trouble recreating the problem we will get back to you.
Regards,
Darin
It is a normal text button (see screenshot). The problem doesn't occur if I use my own images as the "fill style".
Tim
Tim:
After much trial I was able to recreate the problem, and Darrel's "workaround" is correct. As far as I can tell, the problem only occurs when the border of the circle is set to a weight of zero ("0"). For some reason the shape is getting clipped by a pixel. However if you set your shape with a border of one ("1") pixel and set the border color the same as the circle fill it does not occur. We'll have the development team look into a proper fix so that a one pixel border isn't necessary. Thanks for alerting us.
- - Daryl
undefined
Daryl, does Lectora use any raphael.js code? If so, there is a sub-pixel offset issue (and a fix) you should be aware of.
Darrel
Daryl, thank you very much. It would be nice to have it fixed but of course adding a border to the form is an easy enough workaround.
Tim
undefined
Discussions have been disabled for this post