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

Method paintEvent

src/ui/widget.cpp:1027–1056  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1025}
1026
1027bool Widget::paintEvent(Graphics* graphics)
1028{
1029 // For transparent widgets we have to draw the parent first.
1030 if (isTransparent()) {
1031#if _DEBUG
1032 // In debug mode we can fill the area with Red so we know if
1033 // we are drawing the parent correctly.
1034 graphics->fillRect(gfx::rgba(255, 0, 0), clientBounds());
1035#endif
1036
1037 enableFlags(HIDDEN);
1038
1039 if (parent()) {
1040 gfx::Region rgn(parent()->bounds());
1041 rgn.createIntersection(
1042 rgn,
1043 gfx::Region(
1044 graphics->getClipBounds().offset(
1045 graphics->getInternalDeltaX(),
1046 graphics->getInternalDeltaY())));
1047 parent()->paint(graphics, rgn);
1048 }
1049
1050 disableFlags(HIDDEN);
1051 }
1052
1053 PaintEvent ev(this, graphics);
1054 onPaint(ev); // Fire onPaint event
1055 return ev.isPainted();
1056}
1057
1058bool Widget::isDoubleBuffered() const
1059{

Callers 1

paintMethod · 0.80

Calls 12

onPaintFunction · 0.85
getInternalDeltaXMethod · 0.80
getInternalDeltaYMethod · 0.80
isPaintedMethod · 0.80
RegionClass · 0.70
rgbaFunction · 0.50
fillRectMethod · 0.45
boundsMethod · 0.45
createIntersectionMethod · 0.45
offsetMethod · 0.45
getClipBoundsMethod · 0.45
paintMethod · 0.45

Tested by

no test coverage detected