Skip to content
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

LaTeX lines rendered incorrectly when using text #1309

Closed
Kolaru opened this issue Sep 9, 2021 · 4 comments
Closed

LaTeX lines rendered incorrectly when using text #1309

Kolaru opened this issue Sep 9, 2021 · 4 comments

Comments

@Kolaru
Copy link
Contributor

Kolaru commented Sep 9, 2021

For example the bar of the sqrt:

text(L"\sqrt{2}")

image

Using space=:data put the line at the correct place with the correct length, but an incorrect thickness:

text(L"\sqrt{2}", space=:data)

image

I think it's a Makie bug because using it in labels work just fine.

Examples generated with CairoMakie.

First reported in Kolaru/MathTeXEngine.jl#28

@jkrumbiegel
Copy link
Member

Yeah this is because the linesegments need to be inversely projected first and I didn't have time to figure out how. If anybody feels like it, this would be the place https://github.com/JuliaPlots/Makie.jl/blob/master/src/basic_recipes/text.jl#L162

@ffreyer
Copy link
Collaborator

ffreyer commented Sep 22, 2021

A temporary fix for GLMakie and probably WGLMakie would be to pass the camera matrices directly like I did for DataInspector. I.e. something along the lines of

linesegments!(
    ax, 
     map(pos -> project(
        camera(ax.scene).projectionview[],
        Vec2f(widths(pixelarea(ax.scene)[])),
        apply_transform(transform_func_obs(plot)[], pos)
    ), positions), # this should be changed to update when any of those Observables update
    projection = camera(ax.scene).pixel_space,
    view = Mat4f0(I),
    projectionview = camera(ax.scene).poixel_space,
    ...
)

@jkrumbiegel
Copy link
Member

will be fixed by #2020 if it goes through as is

@ffreyer
Copy link
Collaborator

ffreyer commented Aug 22, 2024

Is fixed

@ffreyer ffreyer closed this as completed Aug 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants