Giter VIP home page Giter VIP logo

Comments (4)

GoogleCodeExporter avatar GoogleCodeExporter commented on September 27, 2024
r208

Fix for linear gradient angle calculation.

Gradient transformations are now applied to the point set x1,x2,y1,y2 instead 
of the
gradient matrix.
I think that is how it is supposed to function. Not 100% sure.

If there is only 1 stop or x1=x2 && y1=y2 a solid fill is used.

Also, moves matrix calculation out of gradient class and into linear gradient 
class.
The radial gradient class will eventually have its own matrix calculation.

Original comment by [email protected] on 14 Feb 2009 at 5:53

from svgweb.

GoogleCodeExporter avatar GoogleCodeExporter commented on September 27, 2024
Fixed on the trunk in r295:
Improve gradient bounds calculation.
Support objectBoundingBox values from 0 to 1,
which represent the area of the element to be filled.

All the files mentioned in this Issue appear to render correctly. I consider 
this
Issue resolved.

I evaluated the calculation that uses createGradientBox and was able to get it
working, but there were problems with rotated gradients. I am willing to review 
a
focused revision based on the trunk which uses createGradientBox and works with 
all
the files in com/sgweb/svg/tests/.

Original comment by [email protected] on 22 Mar 2009 at 4:22

from svgweb.

GoogleCodeExporter avatar GoogleCodeExporter commented on September 27, 2024
Further testing reveals that the current bounding box matrix calculations are 
only
correct for userSpaceOnUse gradient units and simple objectBoundingBox 
gradients.

For example, pservers-grad-04-b.svg has a objectBoundingBox matrix vector from 
0,0 to
1,1. The current implementation calculates a gradient matrix that produces 
stripes
that are perpendicular to this vector. In all cases tested, this has been the 
correct
calculation for the equivalent vector in userSpaceOnUse gradient units. 
However, with
objectBoundingBox gradient units the spec specifies that a further 
transformation
from bounding box space to user space needs to occur:

"When the object's bounding box is not square, the stripes that are conceptually
perpendicular to the gradient vector within object bounding box space will 
render
non-perpendicular relative to the gradient vector in user space due to 
application of
the non-uniform scaling transformation from bounding box space to user space."

This Issue applies to both linear and radial gradients.

Original comment by [email protected] on 1 Apr 2009 at 12:07

  • Changed title: Gradient objectBoundingBox calculations need transform to user space
  • Changed state: Accepted

from svgweb.

GoogleCodeExporter avatar GoogleCodeExporter commented on September 27, 2024
Fixed on the trunk in r372:
Implement gradient matrix calculations for objectBoundingBox
gradient units for both linear and radial gradients.
Verbose comments were also added for the existing gradient matrix
calculations for userSpaceOnUse gradient units

These files now render correctly: pservers-grad-02-b.svg, 
pservers-grad-04-b.svg,
pservers-grad-05-b.svg, pservers-grad-12-b.svg, pservers-grad-14-b.svg, and
pservers-grad-15-b.svg.

Original comment by [email protected] on 2 Apr 2009 at 4:15

  • Changed state: Fixed

from svgweb.

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.