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

Method drawElementFrame

Lib/pagebot/elements/views/mapview.py:432–444  ·  view source on GitHub ↗

If `self.showFrame` and `e` is a page, or if `e.showFrame == True`, then draw the frame of the element.

(self, e, origin)

Source from the content-addressed store, hash-verified

430 # D R A W I N G E L E M E N T
431
432 def drawElementFrame(self, e, origin):
433 """If `self.showFrame` and `e` is a page, or if `e.showFrame == True`,
434 then draw the frame of the element."""
435 if (self.showFrame and e.isPage) or e.showFrame:
436 x = origin[0]
437 y = origin[1]
438 mt, mr, mb, ml = e.margin
439 context = self.context
440 context.fill(color(random(), random(), random(), 0.3))
441 context.rect(x-ml, y, max(2,ml), e.h)
442 context.rect(x+e.w, y, max(1,mr), e.h)
443 context.rect(x-ml, y-mb, ml+e.w+mr, max(1,mb))
444 context.rect(x-ml, y+e.h, ml+e.w+mr, max(1,mt))
445
446 def drawElementInfo(self, e, origin):
447 """For debugging this will make the elements show their info. The css

Callers 15

build_drawBotMethod · 0.95
buildMethod · 0.45
buildMethod · 0.45
buildMethod · 0.45
buildMethod · 0.45
buildMethod · 0.45
buildMethod · 0.45
buildMethod · 0.45
buildMethod · 0.45
buildMethod · 0.45
buildMethod · 0.45
buildMethod · 0.45

Calls 3

colorFunction · 0.90
fillMethod · 0.45
rectMethod · 0.45

Tested by

no test coverage detected