adobe / adobe/svg-native-viewer

Default ViewBox can be misleading

Open
#160 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
C++
Stars
164
Forks
42
PR merge metrics
No merged PRs in 30d

Description

Right now, a default of ViewBox of 0 0 320.0 200.0 is assumed if none is provided. If Width and Height are called they would return these numbers which is wrong in my opinion. By default, no size should be assume and we should have APIs that can tell the client if an actual width, height or viewbox attribute was provided or not and if yes, it should allow them to grab those values.

Also, I think the API for rendering should be different. There should be a render function that simply renders the document to a provided canvas without doing any scaling or taking the viewBox into account at all. Then there should be another one that render the ViewBox but scale it up or down as you ask (by providing Width and Height, say).

If you agree, let's discuss the API design. @dirkschulze

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Review the existing ViewBox, Width, Height, and rendering APIs described in the issue, then trace how the default 0 0 320.0 200.0 values are exposed. Define and discuss the API design before implementation; done means omitted dimensions and viewBox values are distinguishable, and rendering can either ignore the viewBox or apply requested scaling.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
computer-graphics
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.