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

Method build

Lib/pagebot/elements/rect.py:46–64  ·  view source on GitHub ↗

Draws the oval in the current context canvas. >>> e = Rect(x=0, y=20, w=500, h=3) >>> e.xy (0pt, 20pt) >>> e.size (500pt, 3pt)

(self, view, origin=ORIGIN, **kwargs)

Source from the content-addressed store, hash-verified

44 """
45
46 def build(self, view, origin=ORIGIN, **kwargs):
47 """Draws the oval in the current context canvas.
48
49 >>> e = Rect(x=0, y=20, w=500, h=3)
50 >>> e.xy
51 (0pt, 20pt)
52 >>> e.size
53 (500pt, 3pt)
54 """
55 p = self.getPosition(view, origin)
56 self.buildFrame(view, p) # Draw optional frame or borders.
57 view.drawElementFrame(self, p)
58 self.context.fill(self.css('fill', noColor))
59 self.context.stroke(self.css('stroke', noColor), self.css('strokeWidth'))
60 px, py, _ = p
61 self.context.rect(px, py, self.w, self.h)
62 self.buildChildElements(view, p, **kwargs)
63 self.restore(view, p)
64 self.drawMeta(view, origin)
65
66 def build_inds(self, view, origin):
67 """It is better to have a separate InDesignContext build tree, since we

Callers

nothing calls this directly

Calls 10

getPositionMethod · 0.80
buildFrameMethod · 0.80
buildChildElementsMethod · 0.80
drawMetaMethod · 0.80
drawElementFrameMethod · 0.45
fillMethod · 0.45
cssMethod · 0.45
strokeMethod · 0.45
rectMethod · 0.45
restoreMethod · 0.45

Tested by

no test coverage detected