示例#1
0
 def on_render(self, cvs, system):
     Box.on_render(self, cvs, system)
     bg = self.bg
     if bg is not None:
         llx = system[self.llx]
         lly = system[self.lly]
         width = system[self.width]
         height = system[self.height]
         cvs.fill(path.rect(llx, lly, width, height), [bg])
     self.child.on_render(cvs, system)
示例#2
0
    def on_render(self, cvs, system):
        if 1:
            x = self.x
            y = self.y
            left = self.left
            right = self.right
            top = self.top
            bot = self.bot
        elif 0:
            x = system[self.x]
            y = system[self.y]
            left = system[self.left]
            right = system[self.right]
            top = system[self.top]
            bot = system[self.bot]

        else:
            self.assign_variables(system)
            x = self.x
            y = self.y
            left = self.left
            right = self.right
            top = self.top
            bot = self.bot

        if not self.DEBUG:
            return
        assert type(x) is float, str(self)
        #cvs.set_line_width(0.5)
        st = [color.rgba(1., 0., 0., 0.5), style.linestyle.solid]
        r = 0.1
        cvs.stroke(path.line(x-r, y-r, x+r, y+r), st)
        cvs.stroke(path.line(x+r, y-r, x-r, y+r), st)
        #bg = RGBA(0.5*random(), 0.5*random(), 0.5*random(), 0.5)
        bg = RGBA(0.5, 0.5, 0., 0.1)
        cvs.fill(path.rect(x-left, y-bot, left+right, top+bot), [bg])
        cvs.stroke(path.rect(x-left, y-bot, left+right, top+bot), st)
示例#3
0
 def on_render(self, cvs, system):
     CompoundBox.on_render(self, cvs, system)
     if not self.grid:
         return
     m, n = self.shape
     xs, ys, ws, hs = self.vs
     width = system[self.width]
     height = system[self.height]
     x = system[self.x]
     y = system[self.y]
     for j in range(n):
         cvs.stroke(path.line(x, y, x, y-height))
         x += system[ws[j]]
     #cvs.stroke(path.line(x, y, x, y-height))
     x = system[self.x]
     y = system[self.y]
     for i in range(m):
         cvs.stroke(path.line(x, y, x+width, y))
         y -= system[hs[i]]
     x = system[self.x]
     y = system[self.y]
     cvs.stroke(path.rect(x, y-height, width, height))
示例#4
0
 def on_render(self, cvs, system):
     Box.on_render(self, cvs, system)
     x = system[self.x]
     y = system[self.y]
     cvs.fill(path.rect(x, y, self.width, self.height), [RGBA(*self.rgba)])