• 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

84.21
/libs/s25main/controls/ctrlImageButton.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 "ctrlImageButton.h"
6
#include <ogl/ITexture.h>
7

8
ctrlImageButton::ctrlImageButton(Window* parent, unsigned id, const DrawPoint& pos, const Extent& size,
508 ✔
9
                                 const TextureColor tc, ITexture* const image, const std::string& tooltip)
508 ✔
10
    : ctrlButton(parent, id, pos, size, tc, tooltip), ctrlBaseImage(image)
508 ✔
11
{}
508 ✔
12

13
void ctrlImageButton::drawContent() const
41 ✔
14
{
15
    // Adding of origin compensates for its substraction inside ITexture::Draw()
16
    auto pos = getDrawPos() + getImage()->getOrigin();
41 ✔
17
    auto size = getSize();
41 ✔
18

19
    if(hasBorder)
41 ✔
20
    {
21
        // Ensure that 3D border is not drawn on
22
        const unsigned borderThickness = 2;
9 ✔
23
        pos += DrawPoint::all(borderThickness);
9 ✔
24
        size -= Extent::all(2 * borderThickness);
9 ✔
25
    }
26

27
    if((state == ButtonState::Pressed || isChecked) && isEnabled)
41 ✔
28
    {
29
        pos += DrawPoint::all(2);
×
30
        size -= Extent::all(2);
×
31
    }
32

33
    Rect drawRect(pos, size);
41 ✔
34
    if(!isEnabled && getModulationColor() == COLOR_WHITE)
41 ✔
NEW
35
        drawImage(drawRect, 0xFF555555);
×
36
    else
37
        drawImage(drawRect);
41 ✔
38
}
41 ✔
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