If `self.showFrame` and `e` is a page, or if `e.showFrame == True`, then draw the frame of the element.
(self, e, origin)
| 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 |