MCPcopy Create free account
hub / github.com/MiniZinc/MiniZincIDE / drawDiamond

Function drawDiamond

cp-profiler/src/cpprofiler/tree/node_drawing.cpp:40–57  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

38} // namespace colors
39
40static void drawDiamond(QPainter &painter, int myx, int myy, bool shadow)
41{
42 using namespace traditional;
43 QPointF points[4] = {QPointF(myx, myy),
44 QPointF(myx + HALF_SOL_W, myy + HALF_SOL_W),
45 QPointF(myx, myy + SOL_WIDTH),
46 QPointF(myx - HALF_SOL_W, myy + HALF_SOL_W)};
47
48 if (shadow)
49 {
50 for (auto &&p : points)
51 {
52 p += QPointF(SHADOW_OFFSET, SHADOW_OFFSET);
53 }
54 }
55
56 painter.drawConvexPolygon(points, 4);
57}
58
59void solution(QPainter &painter, int x, int y, bool selected)
60{

Callers 1

solutionFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected