Skip to content

Extra two pixels in OSD text area width when double font size is used #1

@specadmin

Description

@specadmin
  1. Create 300 pixels window
    WindowConfig wndConf;
    wndConf.left = 0;
    wndConf.top = 10;
    wndConf.width = 300;
    wndConf.height = 100;
    wndConf.bodyColor = CL_YELLOW;
    wndConf.borderColor = CL_RED;
    wndConf.borderWidth = 0;
    OSD.window[0] = createWindow(wndConf);
  1. Add two similar text areas, one with double font size:
    FontRowStyle rowStyle;
    FontAreaStyle fontStyle;
    map1->addEmptyRow(20);
    rowStyle.doubleSize = true;
    rowStyle.tracking = 8;
    CFontRow* row1 = map1->addRow(36, rowStyle);
    fontStyle.alignment = ALIGN_CENTER;
    fontStyle.fontColor = CL_YELLOW;
    fontStyle.bgColor = CL_BLUE;
    fontStyle.fontFace = FONT_BASIC;
    row1->addArea(0, 290, "OK", fontStyle);
    map1->addEmptyRow(1);
    rowStyle.doubleSize = false;
    CFontRow* row2 = map1->addRow(18, rowStyle);
    row2->addArea(0, 290, "LOOK AROUND", fontStyle);

Result: area #1 has 292 pixels width, while area #2 has 290, as expected to be.

Expectation: all areas should have the width, as defined in addArea() method.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions