Browse Source

Cleanup, small fix for previous commits

tags/v1.9.11
falkTX 6 years ago
parent
commit
5581789302
1 changed files with 12 additions and 13 deletions
  1. +12
    -13
      source/patchcanvas.py

+ 12
- 13
source/patchcanvas.py View File

@@ -2404,12 +2404,12 @@ class CanvasBox(QGraphicsItem):
port_spacing = canvas.theme.port_height + canvas.theme.port_spacing

# Get Max Box Width, vertical ports re-positioning
port_types = [PORT_TYPE_AUDIO_JACK, PORT_TYPE_MIDI_JACK, PORT_TYPE_MIDI_ALSA, PORT_TYPE_PARAMETER]
port_types = [PORT_TYPE_AUDIO_JACK, PORT_TYPE_MIDI_JACK, PORT_TYPE_MIDI_ALSA, PORT_TYPE_PARAMETER]
last_in_type = last_out_type = PORT_TYPE_NULL
last_in_pos = last_out_pos = canvas.theme.box_header_height + canvas.theme.box_header_spacing

for port_type in port_types:
for port in port_list:

if port.port_type != port_type:
continue

@@ -2433,14 +2433,13 @@ class CanvasBox(QGraphicsItem):
port.widget.setY(last_out_pos)
last_out_pos += port_spacing


self.p_width = max(self.p_width, 30 + max_in_width + max_out_width)

# Horizontal ports re-positioning
inX = 1 + canvas.theme.port_offset
outX = self.p_width - max_out_width - canvas.theme.port_offset - 13
for port_type in port_types:
for port in port_type[1]:
for port in port_list:
if port.port_mode == PORT_MODE_INPUT:
port.widget.setX(inX)
port.widget.setPortWidth(max_in_width)
@@ -2448,8 +2447,8 @@ class CanvasBox(QGraphicsItem):
elif port.port_mode == PORT_MODE_OUTPUT:
port.widget.setX(outX)
port.widget.setPortWidth(max_out_width)
self.p_height = max(last_in_pos, last_out_pos)

self.p_height = max(last_in_pos, last_out_pos)
self.p_height += max(canvas.theme.port_spacing, canvas.theme.port_spacingT) - canvas.theme.port_spacing
self.p_height += canvas.theme.box_pen.widthF()

@@ -2788,14 +2787,14 @@ class CanvasIcon(QGraphicsSvgItem):
return self.p_size

def paint(self, painter, option, widget):
if self.m_renderer:
painter.save()
painter.setRenderHint(QPainter.Antialiasing, False)
painter.setRenderHint(QPainter.TextAntialiasing, False)
self.m_renderer.render(painter, self.p_size)
painter.restore()
else:
QGraphicsSvgItem.paint(self, painter, option, widget)
if not self.m_renderer:
return QGraphicsSvgItem.paint(self, painter, option, widget)
painter.save()
painter.setRenderHint(QPainter.Antialiasing, False)
painter.setRenderHint(QPainter.TextAntialiasing, False)
self.m_renderer.render(painter, self.p_size)
painter.restore()

# ------------------------------------------------------------------------------
# canvasportglow.cpp


Loading…
Cancel
Save