MCPcopy Create free account
hub / github.com/DFHack/dfhack / fillRect

Method fillRect

library/modules/Screen.cpp:389–407  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

387}
388
389bool Screen::fillRect(const Pen &pen, int x1, int y1, int x2, int y2, bool map)
390{
391 auto dim = getWindowSize();
392 if (!gps || !pen.valid()) return false;
393
394 if (x1 < 0) x1 = 0;
395 if (y1 < 0) y1 = 0;
396 if (x2 >= dim.x) x2 = dim.x-1;
397 if (y2 >= dim.y) y2 = dim.y-1;
398 if (x1 > x2 || y1 > y2) return false;
399
400 for (int x = x1; x <= x2; x++)
401 {
402 for (int y = y1; y <= y2; y++)
403 doSetTile(pen, x, y, map);
404 }
405
406 return true;
407}
408
409bool Screen::drawBorder(const std::string &title)
410{

Callers

nothing calls this directly

Calls 2

doSetTileFunction · 0.85
validMethod · 0.80

Tested by

no test coverage detected