MCPcopy Create free account
hub / github.com/danoon2/Boxedwine / drawRectangle

Method drawRectangle

source/x11/xdrawable.cpp:242–252  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

240}
241
242int XDrawable::drawRectangle(KThread* thread, const std::shared_ptr<XGC>& gc, S32 x, S32 y, U32 width, U32 height) {
243 if (gc->clip_rects.size() || gc->values.clip_mask || gc->values.clip_x_origin || gc->values.clip_y_origin) {
244 klog("XDrawable::drawRectangle clipping not implemented");
245 }
246 // draw rectangle with no overlapping pixels
247 drawLine(thread, gc, x, y, x + width, y); // top (includes left and right)
248 drawLine(thread, gc, x + width, y + 1, x + width, y + height); // right ( includes bottom but not top)
249 drawLine(thread, gc, x, y + 1, x, y + height); // left (includes bottom but not top)
250 drawLine(thread, gc, x + 1, y + height, x + width - 1, y + height); // bottom (does not include left and right)
251 return Success;
252}

Callers 1

x11_DrawRectangleFunction · 0.80

Calls 3

klogFunction · 0.85
drawLineFunction · 0.50
sizeMethod · 0.45

Tested by

no test coverage detected