Esempio n. 1
0
    def polyLine(self, state: PolyLine):
        LOG.debug(state)
        p = self._paint(self.surface)
        p.setPen(QPen(rgb_to_qcolor(state.penColor)))
        set_rop2(state.rop2, p)

        polygon = QPolygon()
        polygon.append(QPoint(state.x0, state.y0))
        for (x, y) in state.points:
            polygon.append(QPoint(x, y))

        p.drawPolyline(polygon)
        self._end(p)
Esempio n. 2
0
    def polygonSc(self, state: PolygonSc):
        LOG.debug(state)
        p = self._paint(self.surface)
        p.setBrush(QBrush(rgb_to_qcolor(state.brushColor)))
        set_rop2(state.rop2, p)

        polygon = QPolygon()
        polygon.append(QPoint(state.x0, state.y0))
        for (x, y) in state.points:
            polygon.append(QPoint(x, y))

        p.drawPolygon(polygon, _fill[state.fillMode])
        self._end(p)
Esempio n. 3
0
    def polygonCb(self, state: PolygonCb):
        LOG.debug(state)
        p = self._paint(self.surface)
        self._brush(state.brush)
        p.brush().setColor(rgb_to_qcolor(state.fg))
        p.setBackground(QBrush(rgb_to_qcolor(state.bg)))
        set_rop2(state.rop2, p)

        # Handle background mode.
        if state.brush.style in [BrushStyle.PATTERN, BrushStyle.HATCHED]:
            p.setBackgroundMode(Qt.TransparentMode if state.bgMode == BACKMODE_TRANSPARENT else Qt.OpaqueMode)

        polygon = QPolygon()
        polygon.append(QPoint(state.x0, state.y0))
        for (x, y) in state.points:
            polygon.append(QPoint(x, y))

        p.drawPolygon(polygon, _fill[state.fillMode])
        self._end(p)