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

Method build

Lib/pagebot/elements/variablefonts/paragraphs.py:72–86  ·  view source on GitHub ↗

Default drawing method just drawing the frame. Probably will be redefined by inheriting element classes.

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

Source from the content-addressed store, hash-verified

70 self.labelSize = labelSize # If undefined, then don't draw labels.
71
72 def build(self, view, origin=ORIGIN, **kwargs):
73 """Default drawing method just drawing the frame. Probably will be
74 redefined by inheriting element classes."""
75 c = self.context
76 p = pointOffset(self.origin, origin)
77 p = self._applyScale(view, p)
78 p = self._applyAlignment(p) # Ignore z-axis for now.
79 self.buildFrame(view, p) # Draw optional background fill, frame or borders.
80
81 # Let the view draw frame info for debugging, in case view.showFrame == True
82 view.drawElementFrame(self, p)
83 # Draw that actual content of the element by stacked specimen rectangles.
84 self.drawStacked(view, p, **kwargs)
85 self._restoreScale(view)
86 view.drawElementInfo(self, origin) # Depends on flag 'view.showElementInfo'
87
88 def getText(self, tag, cnt=None, charCnt=None):
89 """If the tag type of text is in self.words, then take a random choice

Callers

nothing calls this directly

Calls 8

drawStackedMethod · 0.95
pointOffsetFunction · 0.90
_applyScaleMethod · 0.80
_applyAlignmentMethod · 0.80
buildFrameMethod · 0.80
_restoreScaleMethod · 0.80
drawElementFrameMethod · 0.45
drawElementInfoMethod · 0.45

Tested by

no test coverage detected