Skip to content

Fix: fixed handling of invalid font size in macros.h

Description

This merge request addresses issue #1047, which was a regression causing errors related to negative pixel sizes in the example project ENSO. The issue stemmed from recent refactoring and the switch to point sizes, leading to the following error messages in terminal during execution:

QFont::setPixelSize: Pixel size <= 0 (-1)

Changes Made:

  • Updated the macro definition of READ_QFONT in src/backend/lib/macros.h.
  • Added a condition to ensure the font size is greater than zero (size > 0) before setting the pixel size.

Before

before

After

after

Why This Fix Is Required:

The fix prevents the application from attempting to set invalid pixel sizes (<= 0), ensuring stable behavior and eliminating unnecessary error messages in the output.

Conformity

  • Changelog entry: Updated to reflect the resolution of issue #1047.
  • Unit tests: Verified the fix by testing with the example project ENSO.
  • Update INSTALL: N/A (No installation-related changes).
  • Downport: N/A.
  • Fixes: #1047

When external dependencies are removed

  • Reporting to: N/A

Merge request reports

Loading