• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

Return-To-The-Roots / s25client / 44076625557

17 Nov 2026 11:43AM UTC coverage: 51.803% (-0.002%) from 51.805%
44076625557

push

github

web-flow
Merge pull request #2018 from Return-To-The-Roots/refactor/lowerCamelCase-methods

Rename Msg_* handlers to lowerCamelCase

8121 of 16693 new or added lines in 565 files covered. (48.65%)

323 existing lines in 133 files now uncovered.

24236 of 46785 relevant lines covered (51.8%)

49647.74 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

83.33
/libs/s25main/controls/ctrlText.cpp
1
// Copyright (C) 2005 - 2021 Settlers Freaks (sf-team at siedler25.org)
2
//
3
// SPDX-License-Identifier: GPL-2.0-or-later
4

5
#include "ctrlText.h"
6

7
#include "ogl/glFont.h"
8
#include <utility>
9

10
ctrlBaseText::ctrlBaseText(std::string text, const unsigned color, const glFont* font)
502 ✔
11
    : text(std::move(text)), color_(color), font(font)
502 ✔
12
{}
502 ✔
13

14
void ctrlBaseText::setText(const std::string& text)
565 ✔
15
{
16
    this->text = text;
565 ✔
17
}
565 ✔
18

NEW
19
void ctrlBaseText::setFont(glFont* font)
×
20
{
21
    this->font = font;
×
22
}
×
23

24
ctrlText::ctrlText(Window* parent, unsigned id, const DrawPoint& pos, const std::string& text, unsigned color,
231 ✔
25
                   FontStyle format, const glFont* font)
231 ✔
26
    : Window(parent, id, pos), ctrlBaseText(text, color, font), format_(format),
27
      maxWidth_(static_cast<unsigned short>(-1))
231 ✔
28
{}
231 ✔
29

30
Rect ctrlText::getBoundaryRect() const
9 ✔
31
{
32
    if(text.empty())
9 ✔
NEW
33
        return Rect(getDrawPos(), 0, 0);
×
34
    else
35
    {
36
        Rect bounds = font->getBounds(getDrawPos(), text, format_);
9 ✔
37
        if(bounds.getSize().x > maxWidth_)
9 ✔
38
            bounds.setSize(Extent(maxWidth_, bounds.getSize().y));
1 ✔
39
        return bounds;
9 ✔
40
    }
41
}
42

43
void ctrlText::drawImpl()
110 ✔
44
{
45
    if(!text.empty())
110 ✔
46
        font->draw(getDrawPos(), text, format_, color_, maxWidth_);
101 ✔
47
}
110 ✔
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE TRIAL · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc