def putrule(self, height, width, advancepos, fontmap): self.flushtext(fontmap) x1 = self.pos[_POS_H] * self.pyxconv y1 = -self.pos[_POS_V] * self.pyxconv w = width * self.pyxconv h = height * self.pyxconv if height > 0 and width > 0: if self.debug: self.debugfile.write( "%d: %srule height %d, width %d (???x??? pixels)\n" % (self.filepos, advancepos and "set" or "put", height, width)) self.actpage.fill(path.rect_pt(x1, y1, w, h)) else: if self.debug: self.debugfile.write( "%d: %srule height %d, width %d (invisible)\n" % (self.filepos, advancepos and "set" or "put", height, width)) if advancepos: if self.debug: self.debugfile.write( " h:=%d+%d=%d, hh:=???\n" % (self.pos[_POS_H], width, self.pos[_POS_H] + width)) self.pos[_POS_H] += width * self.scale
def dobackground(self): if self.did(self.dobackground): return if self.backgroundattrs is not None: self.draw( path.rect_pt(self.xpos_pt, self.ypos_pt, self.width_pt, self.height_pt), self.backgroundattrs)
def putrule(self, height, width, advancepos, fontmap): self.flushtext(fontmap) x1 = self.pos[_POS_H] * self.pyxconv y1 = -self.pos[_POS_V] * self.pyxconv w = width * self.pyxconv h = height * self.pyxconv if height > 0 and width > 0: if self.debug: self.debugfile.write( "%d: %srule height %d, width %d (???x??? pixels)\n" % (self.filepos, advancepos and "set" or "put", height, width) ) self.actpage.fill(path.rect_pt(x1, y1, w, h)) else: if self.debug: self.debugfile.write( "%d: %srule height %d, width %d (invisible)\n" % (self.filepos, advancepos and "set" or "put", height, width) ) if advancepos: if self.debug: self.debugfile.write(" h:=%d+%d=%d, hh:=???\n" % (self.pos[_POS_H], width, self.pos[_POS_H] + width)) self.pos[_POS_H] += width * self.scale
def dobackground(self): if self.did(self.dobackground): return if self.backgroundattrs is not None: self.layer("background").draw(path.rect_pt(self.xpos_pt, self.ypos_pt, self.width_pt, self.height_pt), self.backgroundattrs)