(self)
return surf, xoff, yoff
Note this discards half a line width inside the box!
Note this discards half a line width inside the box!
Note this discards half a line width inside the box!
def get_inner_mask(self):
        """Note this discards half a line width inside the box!"""
        cr, surf, line_width, width, height, xoff, yoff = self.prepare_mask()

        if self.obj.form == "ellipse":
            cr.save()

            cr.scale((width - 3*line_width) / 2.0, (height - 3*line_width) / 2.0)
            cr.arc(0, 0, 1.0, 0, 2*math.pi)

            # Restore old matrix (without removing the current path)
            cr.restore()
        else:
            cr.translate(-0.5 * width, -0.5 * height)
            cr.rectangle(1.5 * line_width, 1.5 * line_width, width - 3 * line_width, height - 3 * line_width)

        cr.fill()
        surf.flush()
        del cr

        return surf, xoff, yoff
def get_inner_mask ( self ) : cr , surf , line_width , width , height , xoff , yoff = self . prepare_mask ( ) if self . obj . form == "ellipse" : cr . save ( ) cr . scale ( ( width - 3 * line_width ) / 2.0 , ( height - 3 * line_width ) / 2.0 ) cr . arc ( 0 , 0 , 1.0 , 0 , 2 * math . pi ) # Restore old matrix (without removing the current path) cr . restore ( ) else : cr . translate ( - 0.5 * width , - 0.5 * height ) cr . rectangle ( 1.5 * line_width , 1.5 * line_width , width - 3 * line_width , height - 3 * line_width ) cr . fill ( ) surf . flush ( ) del cr return surf , xoff , yoff