-
-
Notifications
You must be signed in to change notification settings - Fork 52
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Drawing LaTeX Improvements #224
base: main
Are you sure you want to change the base?
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)
end Somehow, 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)
end and 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.md
with whatever changes/features I added with this PR?Project.toml
+ set an upper bound of the dependency (if applicable)?test
directory (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
circle
object to cover up/uncover the LaTeX being animated. I propose to add additional shapes (such as rectangles) to modify this behavior.