Skip to content

[Bug]: DrawableText default ctor triggers assertion in juce::FontOptions::withHeight #1606

@EikeAtOT

Description

@EikeAtOT

Detailed steps on how to reproduce the bug

Instantiate a juce::DrawableText through its default constructor. The ctor calls DrawableText::setBoundingBox which ultimately ends up calling DrawableText::refreshBounds using the uninitialised member fontHeight which is NaN at that point.

What is the expected behaviour?

No assertion on default construction

Operating systems

macOS

What versions of the operating systems?

26.1

Architectures

x86_64

Stacktrace

#0	0x000000010037d4d4 in juce::FontOptions::withHeight at JUCE/modules/juce_graphics/fonts/juce_FontOptions.h:145
#1	0x00000001002d9418 in juce::Font::SharedFontInternal::setHeight at JUCE/modules/juce_graphics/fonts/juce_Font.cpp:321
#2	0x00000001002d9041 in juce::Font::setHeight at JUCE/modules/juce_graphics/fonts/juce_Font.cpp:599
#3	0x00000001006131a8 in juce::DrawableText::refreshBounds at JUCE/JUCE/modules/juce_gui_basics/drawables/juce_DrawableText.cpp:151
#4	0x0000000100612dbb in juce::DrawableText::setBoundingBox at JUCE/JUCE/modules/juce_gui_basics/drawables/juce_DrawableText.cpp:120
#5	0x0000000100612b3a in juce::DrawableText::DrawableText at JUCE/JUCE/modules/juce_gui_basics/drawables/juce_DrawableText.cpp:42
#6	0x0000000100612ea5 in juce::DrawableText::DrawableText at JUCE/JUCE/modules/juce_gui_basics/drawables/juce_DrawableText.cpp:41

Plug-in formats (if applicable)

No response

Plug-in host applications (DAWs) (if applicable)

No response

Testing on the develop branch

I have not tested against the develop branch

Code of Conduct

  • I agree to follow the Code of Conduct

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions