MCPcopy Create free account
hub / github.com/PolyMC/PolyMC / paintEvent

Method paintEvent

launcher/ui/widgets/IconLabel.cpp:26–43  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

24}
25
26void IconLabel::paintEvent(QPaintEvent *)
27{
28 QPainter p(this);
29 QRect rect = contentsRect();
30 int width = rect.width();
31 int height = rect.height();
32 if(width < height)
33 {
34 rect.setHeight(width);
35 rect.translate(0, (height - width) / 2);
36 }
37 else if (width > height)
38 {
39 rect.setWidth(height);
40 rect.translate((width - height) / 2, 0);
41 }
42 m_icon.paint(&p, rect);
43}

Callers

nothing calls this directly

Calls 2

translateMethod · 0.80
paintMethod · 0.45

Tested by

no test coverage detected