In my never-ending quest to make my life easier, I've encountered something to make it more difficult.
Has anyone had any experience with why creating or editing objects in a Google Slide with Google Apps Script results in an inaccurate floating point version that's kinda close?
Example, creating an object:
SlidesApp
.getActivePresentation()
.getSlides()[0]
.insertShape(SlidesApp.ShapeType.RECTANGLE, 20, 20, 200, 200);
But the resulting rectangle has these properties:
Top: 20
Left: 20
Width: 200.00787401574803
Height: 200.00787401574803
And what's just as bad is the top and left 1px borders aren't pixel perfect as you'd expect given the correct top and left whole number value.
I discovered this because my first attempt at all this was to round the x/y,w/h to get shapes to at least be clean on the page, and that resulted in the same issues.