Skip to content

Add Angle helper and improve related APIs#140

Merged
abey79 merged 1 commit into
masterfrom
vsvg-api-update
May 31, 2024
Merged

Add Angle helper and improve related APIs#140
abey79 merged 1 commit into
masterfrom
vsvg-api-update

Conversation

@abey79

@abey79 abey79 commented May 31, 2024

Copy link
Copy Markdown
Owner

This PR introduces Angle, an helper to deal with radian/degree angles. It replaces the rotate_*_deg methods of the Transform trait, which are removed.

Note: Angle uses radians internally, and radians is the expected unit for all APIs. However, when parsing strings without unit, degrees are expected instead (since it's most commonly used). Likewise, the whiskers widget for Angle defaults to using degrees for display (can be changed using #[param(rad)].

Also:

  • Improve the Length with support for ctx.rnd_range().
  • Change many APIs to accept impl Into<f64> for compatibility with Length and Angle.
  • Add parsing support to Length and Unit.
  • Update the webdemo.

@abey79 abey79 added common Relates to multiple crates vsvg Relates to vsvg feature New feature breaking Breaking change and removed common Relates to multiple crates labels May 31, 2024
@abey79 abey79 merged commit 23b79fc into master May 31, 2024
@abey79 abey79 deleted the vsvg-api-update branch May 31, 2024 11:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

breaking Breaking change feature New feature vsvg Relates to vsvg

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant