Ejemplo n.º 1
0
 def rclickpalettecanvas(self, event):
     i = self.getclickedpalette(event)
     if i < len(self.pixelgrid.palette):
         tool.undoblock(self.getCurrentSelection())
         self.pixelgrid.flipColors(self.currentcolor, i,
                                   self.getCurrentSelection())
         self.redraw()
Ejemplo n.º 2
0
 def rclickpalettecanvas(self, event):
     i = self.getclickedpalette(event)
     if i < len(self.pixelgrid.palette):
         tool.undoblock(self.getCurrentSelection())
         self.pixelgrid.flipColors(self.currentcolor, i,
                                   self.getCurrentSelection())
         self.redraw()
Ejemplo n.º 3
0
    def paste(self, event=None):
        if self.clipboard is None:
            return

        if (self.selecting):
            x = min(self.selection[0], self.selection[2])
            y = min(self.selection[1], self.selection[3])
        else:
            x = self.selectedx
            y = self.selectedy
        
        currentsel = self.getCurrentSelection()
        tool.undoblock([currentsel[0],
                        currentsel[1],
                        currentsel[0]+self.clipboard.width,
                        currentsel[1]+self.clipboard.height])
        self.pixelgrid.mergeSubset(self.clipboard, x, y)
        self.redraw()
Ejemplo n.º 4
0
    def paste(self, event=None):
        if self.clipboard is None:
            return

        if (self.selecting):
            x = min(self.selection[0], self.selection[2])
            y = min(self.selection[1], self.selection[3])
        else:
            x = self.selectedx
            y = self.selectedy
        
        currentsel = self.getCurrentSelection()
        tool.undoblock([currentsel[0],
                        currentsel[1],
                        currentsel[0]+self.clipboard.width,
                        currentsel[1]+self.clipboard.height])
        self.pixelgrid.mergeSubset(self.clipboard, x, y)
        self.redraw()