Page MenuHome

Fix strips text offset when zooming VSE timeline
ClosedPublic

Authored by Richard Antalik (ISS) on Feb 22 2019, 1:06 AM.

Details

Summary

Glyph cache is cleared by UI_view2d_zoom_cache_reset, when zooming V2D, but is required to calculate text height in UI_view2d_text_cache_draw

This caused text in strips to "jump around"

There was a comment in UI_view2d_zoom_cache_reset:
While scaling we can accumulate fonts at many sizes (~20 or so).
Not an issue with embedded font, but can use over 500Mb with i18n ones! See [#38244].

Diff Detail

Repository
rB Blender

Event Timeline

Brecht Van Lommel (brecht) requested changes to this revision.EditedFeb 22 2019, 11:55 AM

Good find! I don't think this is strictly reliable still, font->size is the last used font size for drawing some other unknown part of the UI.

Instead I think UI_view2d_text_cache_draw should be fixed, adding a BLF_set_default() right before BLF_height() so that the size initialized to the same value as BLF_draw_default() will use later in the function.

This revision now requires changes to proceed.Feb 22 2019, 11:55 AM
Richard Antalik (ISS) edited the summary of this revision. (Show Details)

Indeed, this is much better. Thanks.

This revision is now accepted and ready to land.Feb 22 2019, 6:57 PM
This revision was automatically updated to reflect the committed changes.

@Brecht Van Lommel (brecht), Sorry I accidentally committed D4396: Fix VSE color picker with this.

Don't know what to do :(

I asked in IRC, I was suggested to revert commit and commit again, so I did that.

Sorry I will be more careful next time.

I am doing this manually, can arcanist prevent such mistakes, or does it use local repo to push diffs?