MCPcopy Create free account
hub / github.com/PageBot/PageBot / marker

Method marker

Lib/pagebot/contexts/basecontext/basecontext.py:1093–1115  ·  view source on GitHub ↗
(self, x, y, r=1, fontSize=5, prefix=None, color=None)

Source from the content-addressed store, hash-verified

1091 # Some drawing macros.
1092
1093 def marker(self, x, y, r=1, fontSize=5, prefix=None, color=None):
1094 # TODO: move to elements.
1095 x = round(x)
1096 y = round(y)
1097 red = (1, 0, 0)
1098 s = '(%s, %s)' % (x, y)
1099
1100 if prefix:
1101 s = '%s %s' % (prefix, s)
1102
1103 if color is None:
1104 color = red
1105
1106 style = dict(font='PageBot-Regular', fontSize=pt(fontSize), textFill=color)
1107 bs = self.newString(s, style=style)
1108 oldStroke = self._stroke
1109 oldFill = self._fill
1110 self.text(bs, (x+1, y+1))
1111 self.fill(color)
1112 self.stroke(None)
1113 self.circle(x, y, r)
1114 self.fill(oldFill)
1115 self.stroke(oldStroke)
1116
1117 def bluntCornerRect(self, x, y, w, h, offset=5):
1118 """Draws a rectangle in the canvas. This method is using the Bézier

Callers

nothing calls this directly

Calls 6

newStringMethod · 0.95
fillMethod · 0.95
strokeMethod · 0.95
circleMethod · 0.95
ptFunction · 0.90
textMethod · 0.45

Tested by

no test coverage detected