(self, e, origin)
| 534 | e._restoreScale(self) |
| 535 | |
| 536 | def drawElementOrigin(self, e, origin): |
| 537 | if not (self.showOrigin or e.showOrigin): |
| 538 | return |
| 539 | |
| 540 | px, py, _ = pointOffset(e.origin, origin) |
| 541 | |
| 542 | S = e.css('viewInfoOriginMarkerSize', pt(5)) |
| 543 | # Draw origin of the element. |
| 544 | fill = e.css('viewInfoOriginMarkerFill', noColor) |
| 545 | stroke = e.css('viewInfoOriginMarkerStroke', blackColor) |
| 546 | width = e.css('viewInfoOriginMarkerStrokeWidth', pt(0.25)) |
| 547 | # Transparent fill, so we can see the marker on dark backgrounds. |
| 548 | self.context.fill(fill) |
| 549 | self.context.stroke(stroke, width) |
| 550 | self.context.oval(px-S, py-S, 2*S, 2*S) |
| 551 | self.context.line((px-S, py), (px+S, py)) |
| 552 | self.context.line((px, py-S), (px, py+S)) |
| 553 | |
| 554 | if (self.showDimensions and e.isPage) or e.showDimensions: |
| 555 | bs = self.context.newString(e.xy, style=dict(font=self.css('viewInfoFont'), |
| 556 | fontSize=self.css('viewInfoFontSize'), leading=self.css('viewInfoLeading'), |
| 557 | textFill=color(0.1))) |
| 558 | w, h = bs.textSize |
| 559 | self.context.text(bs, (px - w/2, py + S*1.5)) |
| 560 | |
| 561 | def drawMissingElementRect(self, e, origin): |
| 562 | """When designing templates and pages, this will draw a filled |
no test coverage detected