Coder Social home page Coder Social logo

Comments (5)

mgrudzinska avatar mgrudzinska commented on June 15, 2024 1
<svg viewBox="-10 0 50 20" xmlns="http://www.w3.org/2000/svg">
  <!-- No dash array -->
  <line x1="0" y1="1" x2="30" y2="1" stroke="black" />

  <!-- No dash offset -->
  <line x1="0" y1="3" x2="30" y2="3" stroke="black" stroke-dasharray="3.4 1.3 2 0.5" stroke-linecap="butt" />


  <line x1="0" y1="5" x2="30" y2="5" stroke="blue"
        stroke-dasharray="3.4 1.3 2 0.5" stroke-dashoffset="1.2" />

  <line x1="0" y1="6.1" x2="30" y2="6.1" stroke="blue"
        stroke-dasharray="3.4 1.3 2 0.5" stroke-dashoffset="8.4" />


  <line x1="0" y1="8" x2="30" y2="8" stroke="blue"
        stroke-dasharray="3.4 1.3 2 0.5" stroke-dashoffset="4.1" />

  <line x1="0" y1="9.1" x2="30" y2="9.1" stroke="blue"
        stroke-dasharray="3.4 1.3 2 0.5" stroke-dashoffset="11.3" />


  <line x1="0" y1="11" x2="30" y2="11" stroke="blue"
        stroke-dasharray="3.4 1.3 2 0.5" stroke-dashoffset="5.7" />

  <line x1="0" y1="12.1" x2="30" y2="12.1" stroke="blue"
        stroke-dasharray="3.4 1.3 2 0.5" stroke-dashoffset="12.9" />
</svg>

result from tvg after my changes (as expected):
Zrzut ekranu 2023-08-16 o 23 52 36

need to test negative values of offset and will be ready :)

from thorvg.

hermet avatar hermet commented on June 15, 2024

Great, I'm looking forward to the result. :-)

from thorvg.

mgrudzinska avatar mgrudzinska commented on June 15, 2024

@hermet
changing api like this Result stroke(const float* dashPattern, uint32_t cnt, float offset = 0.0f) noexcept;
will cause a problem, because we have already Result stroke(uint8_t r, uint8_t g, uint8_t b, uint8_t a = 255) noexcept;

so calling stroke(0, 255, 0) is ambiguous.
I'm not sure how to solve this... we could remove the def value of a but I assume that it's a common api, so probably not the best idea. so a new Result dashOffset(float offset) api?

from thorvg.

hermet avatar hermet commented on June 15, 2024

how about -> strokeDash(dashPattern, patternCnt, offset) ?

from thorvg.

hermet avatar hermet commented on June 15, 2024

ok, you already pushed a patch. Reverting alpha value might be better to go for now.

from thorvg.

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.