Imgui: Triggered IM_ASSERT when building font ranges

Created on 16 Feb 2019  路  8Comments  路  Source: ocornut/imgui

Hello @ocornut,

Just upgraded to latest 1.68 + docking branch and related custom add-ons.
This assertion fails now:
Assertion failed: src_tmp.GlyphsList.Size == src_tmp.GlyphsCount, file C:/prj/#AVA/editor/3rd/@ocornut/imgui_draw.cpp, line 1879

Also, this is the minimal repro-steps case that used to work before.
Apparently, overlapping font ranges were ok before but now it wont build atlas :D

ImGuiIO& io = ImGui::GetIO();
ImFontConfig *cfg = &ImFontConfig();

static const ImWchar default_ranges[] =
{
    0x0020, 0x00FF, // Basic Latin + Latin Supplement
    0x0080, 0x00FF, // Latin_Supplement

    0,
};

io.Fonts->AddFontFromMemoryCompressedTTF( FONT_MAIN_BUF, FONT_MAIN_LEN, FONT_MAIN_SIZE, cfg, default_ranges );
bug docking fontext

All 8 comments

Managed to compile after fixing (manually) many overlapping ranges in many locales (phiew)

The two issues that you mentioned somewhere else are gone :D

Quick feedback after comparing new 1.68+docking against old 1.66+docking.
Minor issues mainly, I understand the branch is under development still, so no hurries :D

  • Loading old imgui.ini crashed; had to delete file to get it working, then recreate previous docking layout . Assertion failed: tab->NameOffset != -1 && tab->NameOffset < TabsNames.Buf.Size, file c:\prj\#ava\editor\3rd\@ocornut\imgui_internal.h, line 1475
  • There is some new random flickering in the blue drop regions when dragging tabs. Even I do not move mouse, there is random flickering going on and off.
  • Also, some minor z-order issues with those very same blue drop regions. At some point one of the tabs went out of focus even if no other tab was overlapping at all. Couldnt give that bar any kind of focus with mouse. Fixed it by reordering layout of surronding tabs. Cannot give repro steps for this.

And now the juicy bits :D
image

Hello,

Could you provide the crashing ini file? Was it an assert or a crash?

Could you provide gif of the other issues?

Will look into them tomorrow.

  1. It was an assert in fact: Assertion failed: tab->NameOffset != -1 && tab->NameOffset < TabsNames.Buf.Size, file c:\prj\#ava\editor\3rd\@ocornut\imgui_internal.h, line 1475 Ini file here: https://github.com/r-lyeh/AVA/blob/30eda74515838554749718668ec3cd5e81daae68/editor/editor.ini

  2. Sure, I will try to record sth.

The issue is much less noticeable in the gif due to low framerate. Sorry.
Repro-steps (I think). Maximize client window. Pick any tab which is large enough. Scroll it so it overlaps right and bottom screen borders. Notice the issue. Note: I am using a single monitor setup right now.

gif

About the z-order issue, I will try to record a gif whenever I found it again, but I havent been able to reproduce it again :)

(1) Fixed the overlapping font range within same font issue now.

(2) For the assert I'll need to investigate further for a repro. If you can get it to repro, a callstack would be helpful. Could you also confirm that tab->NameOffset == -1 there? (And it's not a value referring past the array size?)

(3) For the docking drop overlay moving: do you have multi-viewport enabled? and does the dragged window leads to a new viewport being created? It is frequent to see unsynchronized renders (not always easy to fix depending on codebase/engine, there is a workaround but I'll like to first confirm if your bug is related to multi-viewport).

Please open separate issues when the topics are unrelated (don't hesitate to open 3 issues for 3 different bugs!). Thanks a lot!

  1. Nice!
  2. Cannot reproduce that assert anymore.
  3. Multi? yes. dragging to new viewport? no idea, it is overlapping with the physical monitor borders. ie, there is no more space left so dunno what imgui would do.

ps: oook. i just found 2 new bugs today :) feel free to close this issue and i'll re-open as needed.

Created 3 new issues from derived issues. Original issue is fixed.

Was this page helpful?
0 / 5 - 0 ratings