Conversation
|
@Wikunia, I noticed that there seems to be a strange behavior in my code in providing a rectangular glide. Here is my code: function animate_latex(text, pos::Point, t, action)
svg = get_latex_svg(text)
action == :stroke && (action = :fill)
if t >= 1
translate(pos)
pathsvg(svg)
do_action(action)
translate(-pos)
return
end
pathsvg(svg)
polygon = pathtopoly()
w, h = polywh(polygon)
translate(pos)
pathsvg(svg)
do_action(:clip)
rect(O, t * w, h, :fill)
translate(-pos)
endSomehow, the |
|
It gives you the width and height but not the starting point. You assume the starting point is the origin but this seems to be wrong in this case. You should be able to see it when drawing the rectangle in red and on top the latex. |
|
Hey @Wikunia I tested this again and, though I changed the presumed point, I still have the same problem. Here is what the output of my modified code is now: function animate_latex(text, pos::Point, t, action)
svg = get_latex_svg(text)
action == :stroke && (action = :fill)
if t >= 1
translate(pos)
pathsvg(svg)
do_action(action)
translate(-pos)
return
end
pathsvg(svg)
polygon = pathtopoly()
w, h = polywh(polygon)
sethue("red")
rect(pos, t * w, h, :fill)
pathsvg(svg)
do_action(:clip)
translate(-pos)
endand output: It's almost like the LaTeX is being shifted somehow... Thoughts? |
|
I can't see anything to be honest. Why don't you draw the latex on top of the rectangle to see where it is exactly and why it doesn't match. |
|
Will you continue trying to tackle this @TheCedarPrince ? |
|
Yes @Wikunia - it is on my radar to be worked on in v0.3.x. So, should be one of the first ones I tackle. |


PR Checklist
If you are contributing to
Javis.jl, please make sure you are able to check off each item on this list:CHANGELOG.mdwith whatever changes/features I added with this PR?Project.toml+ set an upper bound of the dependency (if applicable)?testdirectory (if applicable)?Link to relevant issue(s)
#161
How did you address these issues with this PR? What methods did you use?
The draw LaTeX PR was good (#206 ) but I noticed that the drawing animation seems to "swoop" into the frame. This is a result of using the
circleobject to cover up/uncover the LaTeX being animated. I propose to add additional shapes (such as rectangles) to modify this behavior.