Giter Site home page Giter Site logo

Add support for transformations about svg HOT 2 OPEN

bodoni avatar bodoni commented on September 4, 2024
Add support for transformations

from svg.

Comments (2)

dustdfg avatar dustdfg commented on September 4, 2024 1

I just want to add that stored transforms must be a list Vec<Transform> because svg allows several different transforms at the same time: translate(100 100) scale(0.5 0.5). Also the API should be not element.transform(transform: Transform) but rather element.transform(transform: Transform, squash: bool) because user can want to get one matrix after several transforms and not a list of transforms

P.S If you want to know when the list of transforms is more preferable than matrix:

  1. The svg is suited for people reading/editing
  2. You can easily emulate transfom-origin property from svg2 via several sequential transforms

from svg.

IvanUkhov avatar IvanUkhov commented on September 4, 2024

Hello, yes, indeed. There is no higher-level interface for doing this. I myself use exactly the approach you described. Since for constructing data for paths we have it, it could make sense to have it for transformations too.

https://github.com/bodoni/svg/blob/main/src/node/element/path/data.rs

from svg.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.