adobe-research / svgObjectModelGenerator

SVG OM Generator & Writer
Apache License 2.0
49 stars 20 forks source link

When ellipse has an odd number for pixel dimensions, it gets clipped in the svg. #53

Closed joebowden closed 10 years ago

joebowden commented 10 years ago

Test file: http://adobe.ly/1pExE7D (a 453x453px ellipse)

Steps:

  1. Open test file in PS
  2. Generate svg from it
  3. Examine asset in Chrome, and in a text editor

Result: Right and bottom are clipped. In a text editor, you'll see cx, cy, and r = 227, but the width, height, and viewBox are 453x453 (the size of the shape in PS). Hence the clip. Does not happen when dimension has an even number of pixels.

Expected: In this file, cx, cy, and r = 226.5, which is half of pixel dimension of 453, fitting everything without clipping.

joebowden commented 10 years ago

Fixed...increases the viewBox by 1 so whole numbers can be used for cx, cy, and r. Closing.