Skip to content

Commit 1933aed

Browse files
committed
Fixing CI issues
1 parent 3282130 commit 1933aed

4 files changed

Lines changed: 28 additions & 25 deletions

File tree

libs/s25main/RescaleWindowProp.h

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,8 @@ struct ScaleWindowProp
2222
ScaleWindowProp(Extent oldSize, Extent newSize) : oldSize(oldSize), newSize(newSize) {}
2323

2424
template<typename T_Pt>
25-
static T_Pt scale(const T_Pt& value, const Extent& size, const ScaleLimPercent& scalePercentage = ScaleLimPercent(100, 100));
25+
static T_Pt scale(const T_Pt& value, const Extent& size,
26+
const ScaleLimPercent& scalePercentage = ScaleLimPercent(100, 100));
2627

2728
/// Scale the point or size from beeing relative to the oldSize to relative to the newSize
2829
template<typename T_Pt>
@@ -42,8 +43,9 @@ inline T_Pt ScaleWindowProp::operator()(const T_Pt& oldValue, const ScaleLimPerc
4243
{
4344
T_Pt realValue;
4445
T_Pt diff(oldSize - REFERENCE_RESOLUTION);
45-
T_Pt limUnscaleValue(oldValue.x * REFERENCE_RESOLUTION.x / (oldSize.x - diff.x + (diff.x * scalePercentage.x / 100)),
46-
oldValue.y * REFERENCE_RESOLUTION.y / (oldSize.y - diff.y + (diff.y * scalePercentage.y / 100)));
46+
T_Pt limUnscaleValue(
47+
oldValue.x * REFERENCE_RESOLUTION.x / (oldSize.x - diff.x + (diff.x * scalePercentage.x / 100)),
48+
oldValue.y * REFERENCE_RESOLUTION.y / (oldSize.y - diff.y + (diff.y * scalePercentage.y / 100)));
4749
realValue = limUnscaleValue;
4850
// Check for rounding errors
4951
T_Pt checkValue = ScaleWindowProp::scale(realValue, oldSize, scalePercentage);

libs/s25main/Window.cpp

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,8 @@
1717
#include <boost/range/adaptor/reversed.hpp>
1818
#include <cstdarg>
1919

20-
Window::Window(Window* parent, unsigned id, const DrawPoint& pos, const Extent& size, const ScaleLimPercent& scalePercentage)
20+
Window::Window(Window* parent, unsigned id, const DrawPoint& pos, const Extent& size,
21+
const ScaleLimPercent& scalePercentage)
2122
: parent_(parent), id_(id), pos_(pos), size_(size), scalePercentage_(scalePercentage), active_(false),
2223
visible_(true), scale_(false), limit_(false), isInMouseRelay(false), animations_(this)
2324
{
@@ -310,8 +311,7 @@ ctrlDeepening* Window::AddImageDeepening(unsigned id, const DrawPoint& pos, cons
310311
ctrlEdit* Window::AddEdit(unsigned id, const DrawPoint& pos, const Extent& size, TextureColor tc, const glFont* font,
311312
unsigned short maxlength, bool password, bool disabled, bool notify)
312313
{
313-
return AddCtrl(
314-
new ctrlEdit(this, id, pos, size, tc, font, maxlength, password, disabled, notify));
314+
return AddCtrl(new ctrlEdit(this, id, pos, size, tc, font, maxlength, password, disabled, notify));
315315
}
316316

317317
ctrlGroup* Window::AddGroup(unsigned id)
@@ -377,8 +377,8 @@ ctrlProgress* Window::AddProgress(unsigned id, const DrawPoint& pos, const Exten
377377
const std::string& tooltip, const Extent& padding, unsigned force_color,
378378
const std::string& button_minus_tooltip, const std::string& button_plus_tooltip)
379379
{
380-
return AddCtrl(new ctrlProgress(this, id, pos, size, tc, button_minus, button_plus, maximum,
381-
padding, force_color, tooltip, button_minus_tooltip, button_plus_tooltip));
380+
return AddCtrl(new ctrlProgress(this, id, pos, size, tc, button_minus, button_plus, maximum, padding, force_color,
381+
tooltip, button_minus_tooltip, button_plus_tooltip));
382382
}
383383

384384
ctrlScrollBar* Window::AddScrollBar(unsigned id, const DrawPoint& pos, const Extent& size, unsigned short button_height,
@@ -450,8 +450,7 @@ ctrlVarDeepening* Window::AddVarDeepening(unsigned id, const DrawPoint& pos, con
450450
va_list liste;
451451
va_start(liste, parameters);
452452

453-
auto* ctrl =
454-
new ctrlVarDeepening(this, id, pos, size, tc, formatstr, font, color, parameters, liste);
453+
auto* ctrl = new ctrlVarDeepening(this, id, pos, size, tc, formatstr, font, color, parameters, liste);
455454

456455
va_end(liste);
457456

@@ -584,7 +583,8 @@ T_Pt Window::Scale(const T_Pt& pt, const ScaleLimPercent& scalePercentage)
584583
void Window::Scale()
585584
{
586585
pos_ = ScaleWindowProp::scale(pos_, VIDEODRIVER.GetRenderSize());
587-
size_ = ScaleWindowProp::scale(size_, VIDEODRIVER.GetRenderSize(), limit_ ? scalePercentage_ : ScaleLimPercent(100, 100));
586+
size_ =
587+
ScaleWindowProp::scale(size_, VIDEODRIVER.GetRenderSize(), limit_ ? scalePercentage_ : ScaleLimPercent(100, 100));
588588
}
589589

590590
template<class T_Pt>

libs/s25main/Window.h

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,8 @@ class Window
6767
using KeyboardMsgHandler = bool (Window::*)(const KeyEvent&);
6868
using MouseMsgHandler = bool (Window::*)(const MouseCoords&);
6969

70-
Window(Window* parent, unsigned id, const DrawPoint& pos, const Extent& size = Extent(0, 0), const ScaleLimPercent& factors = ScaleLimPercent(100, 100));
70+
Window(Window* parent, unsigned id, const DrawPoint& pos, const Extent& size = Extent(0, 0),
71+
const ScaleLimPercent& scalePercentage = ScaleLimPercent(100, 100));
7172
virtual ~Window();
7273
/// zeichnet das Fenster.
7374
void Draw();
@@ -305,24 +306,24 @@ class Window
305306
/// Sets the limit value, deciding of control size shall be limited.
306307
void SetLimit(bool limit = true) { this->limit_ = limit; }
307308
/// get Scale-Value
308-
bool GetScale() { return this->scale_; }
309+
bool GetScale() const { return this->scale_; }
309310
/// get Limit-Value
310-
bool GetLimit() { return this->limit_; }
311+
bool GetLimit() const { return this->limit_; }
311312
/// zeichnet das Fenster.
312313
virtual void Draw_();
313314
/// Weiterleitung von Nachrichten von abgeleiteten Klassen erlaubt oder nicht?
314315
virtual bool IsMessageRelayAllowed() const;
315316

316317
private:
317-
Window* const parent_; /// Handle auf das Parentfenster.
318-
unsigned id_; /// ID des Fensters.
319-
DrawPoint pos_; /// Position des Fensters.
320-
Extent size_; /// Höhe des Fensters.
321-
ScaleLimPercent scalePercentage_; /// X and Y scaling limiting factors
322-
bool active_; /// Fenster aktiv?
323-
bool visible_; /// Fenster sichtbar?
324-
bool scale_; /// Sollen Controls an Fenstergröße angepasst werden?
325-
bool limit_; /// Should control size be limited?
318+
Window* const parent_; /// Handle auf das Parentfenster.
319+
unsigned id_; /// ID des Fensters.
320+
DrawPoint pos_; /// Position des Fensters.
321+
Extent size_; /// Höhe des Fensters.
322+
ScaleLimPercent scalePercentage_; /// X and Y scaling limiting percentage
323+
bool active_; /// Fenster aktiv?
324+
bool visible_; /// Fenster sichtbar?
325+
bool scale_; /// Sollen Controls an Fenstergröße angepasst werden?
326+
bool limit_; /// Should control size be limited?
326327

327328
std::map<Window*, Rect> lockedAreas_; /// gesperrte Regionen des Fensters.
328329
std::vector<Window*> tofreeAreas_;

libs/s25main/controls/ctrlChat.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,8 @@ ctrlChat::ctrlChat(Window* parent, unsigned id, const DrawPoint& pos, const Exte
3838
SetScale(false);
3939

4040
// Scrollbalken hinzufügen
41-
AddScrollBar(0, DrawPoint(GetSize().x - SCROLLBAR_WIDTH, 0), Extent(SCROLLBAR_WIDTH, GetSize().y), SCROLLBAR_WIDTH, tc,
42-
page_size);
41+
AddScrollBar(0, DrawPoint(GetSize().x - SCROLLBAR_WIDTH, 0), Extent(SCROLLBAR_WIDTH, GetSize().y), SCROLLBAR_WIDTH,
42+
tc, page_size);
4343

4444
SetScale(tmpScale);
4545

0 commit comments

Comments
 (0)