SVG viewport origins and coordinates
VectorPaint viewBox origins: why unchanged SVG coordinates appear elsewhere
Calculate viewport placement for the same rectangle under two viewBox origins and distinguish window movement, object movement and clipping.
On this page
An SVG object's x and y can stay fixed while a changed viewBox origin moves it within the output viewport. Make two files, calculate their positions, then observe and export through an SVG entry actually visible in VectorPaint. W3C defines viewBox as minimum x, minimum y, width and height; whether the installed application preserves those numbers requires actual testing, which is not claimed here.
Set calculable conditions
Both files declare a 200 × 120 viewport and a 100 × 60 viewBox, with matching aspect ratios and a scale factor of two. Color, rectangle position and size remain fixed. The first viewBox is 0 0 100 60; the second is 50 20 100 60. Both rectangles start at (70,30), with width and height 20. These are SVG user coordinates and declared viewport units, not automatically physical screen pixels. Keep both originals and separate working copies.
Save the first window
Copy this entire SVG into a plain-text editor as origin-zero.svg. Keep the namespace and ensure no extra .txt extension appears. The rectangle has no stroke, avoiding an extra boundary-width variable. Do not add a background rectangle that might be mistaken for the viewport after transformation.
<svg xmlns="http://www.w3.org/2000/svg" width="200" height="120" viewBox="0 0 100 60">
<rect x="70" y="30" width="20" height="20" fill="#cc3333"/>
</svg>
Change only the viewBox origin in a copy
Copy the first file as origin-shifted.svg and change only the root's viewBox to 50 20 100 60; the rectangle attributes remain identical. The complete changed file follows. When comparing text, check all four viewBox values and their order so an origin change is not confused with a change in width or height.
<svg xmlns="http://www.w3.org/2000/svg" width="200" height="120" viewBox="50 20 100 60">
<rect x="70" y="30" width="20" height="20" fill="#cc3333"/>
</svg>
Calculate each viewport position
In the first file, the rectangle is (70,30) relative to origin (0,0), so its viewport upper-left is (140,60) and size is 40 × 40. In the second, subtract (50,20): relative position becomes (20,10), mapping to (40,20), with the same 40 × 40 size. Record positions relative to viewport upper-left (0,0). The observation window shifted relative to the coordinate system; source rectangle coordinates did not move. Matching aspect ratios mean no extra letterboxing or alignment offset in this example.
Compare files and visible images
Open both in an SVG-capable reference viewer and use the whole viewport boundary, not the rectangle edge, as reference. The first rectangle sits lower right and the second upper left; their areas remain equal. On transparency, use the viewer frame to locate the viewport and do not treat its checkerboard as part of the graphic. If observations disagree, check file identity, all four viewBox values, viewport dimensions and zoom before comparing absolute screen positions. Record calculated and observed positions separately; an unperformed observation is not a pass.
Inspect import and editing in VectorPaint
Open each working copy through an SVG import or open entry actually visible in the application. Record positions and how canvas boundaries appear. The application might normalize coordinates, convert to shapes or otherwise alter structure, so matching appearance does not prove the original viewBox was retained literally. If the rectangle is selectable, save a copy before moving and record the controls actually shown. If origin cannot be inspected or no import entry exists, mark pending without inventing a menu. Manually dragging an object back is not evidence that the original import was correct.
Make a separate clipping control
Copy the second file and change rectangle x to 140 while retaining width 20. The shifted window spans horizontal coordinates 50–150, placing 140–150 inside and 150–160 outside. A viewport display may show only part of the rectangle; actual clipping also depends on viewport and overflow settings. Record coordinates outside the window separately from what a viewer actually displays. Do not overwrite the two original samples or infer every exporter's clipping strategy from this control.
Recalculate size using all four corners
List the source rectangle's corners: upper-left (70,30), upper-right (90,30), lower-left (70,50) and lower-right (90,50). In the first window subtract (0,0) and multiply by two to get upper-left (140,60), lower-right (180,100). In the second subtract (50,20) before multiplying to get (40,20) and (80,60). Both are 40 wide and high: a move toward the upper-left is not a smaller rectangle. Record calculations separately from viewer observations and align using the whole viewport when a screenshot is scaled; screen pixels do not directly replace these values.
Compare the two source rect attributes x, y, width, height and fill, circling only the changed first two viewBox values. If an application recalculates coordinates on export while appearance agrees, preserve both texts and record structural change and the actual visual result separately, not automatic damage. If the outside-window control displays the full object, record that viewer's overflow behavior rather than calling its coordinates inside the original window.
For each file record source viewBox, source rectangle coordinates, viewport size and visible position after opening; give the control its own row. If the second file overwrites the first, restore from backup before comparing rather than reconstructing lost source from an expected position. If the application's imported canvas shows different units or margins, retain a full-view screenshot and displayed settings before comparing scale. Different displayed units do not necessarily mean source coordinates changed. Mark numerical values unavailable when no value is visible.
Export and deliver
Save editable working drafts and export separate files through available controls. Reopen them to compare viewport boundaries, rectangle positions and size. Inspect coordinates and viewBox in SVG text; a bitmap can establish appearance only, not preservation of source coordinates. Deliver both originals, working copies, outputs and a table of theoretical positions, observed results, import structures and pending items. Mark unperformed reopening or device operations pending.
Related guides and sources
Import and edit SVG; Canvas units.
Checked 21 November 2026: Apple's China lookup lists VectorPaint 1.0.8, requiring iOS / iPadOS 17.0. W3C SVG 2 viewBox specifies the four window values. Sample and arithmetic are original to the exercise.