|
|
@ -1175,8 +1175,8 @@ class FixedAspectRatioLayout(QLayout): |
|
|
|
c_aratio = 1 |
|
|
|
s_aratio = self.aspect_ratio |
|
|
|
item_rect = QRect(QPoint(0, 0), QSize( |
|
|
|
contents.width() if c_aratio < s_aratio else contents.height() * s_aratio, |
|
|
|
contents.height() if c_aratio > s_aratio else contents.width() / s_aratio |
|
|
|
contents.width() if c_aratio < s_aratio else int(contents.height() * s_aratio), |
|
|
|
contents.height() if c_aratio > s_aratio else int(contents.width() / s_aratio) |
|
|
|
)) |
|
|
|
|
|
|
|
content_margins = self.contentsMargins() |
|
|
@ -1187,7 +1187,7 @@ class FixedAspectRatioLayout(QLayout): |
|
|
|
if item.alignment() & Qt.AlignRight: |
|
|
|
item_rect.moveRight(contents.width() + content_margins.right()) |
|
|
|
else: |
|
|
|
item_rect.moveLeft(content_margins.left() + (free_space.width() / 2)) |
|
|
|
item_rect.moveLeft(content_margins.left() + (free_space.width() // 2)) |
|
|
|
else: |
|
|
|
item_rect.moveLeft(content_margins.left()) |
|
|
|
|
|
|
@ -1195,7 +1195,7 @@ class FixedAspectRatioLayout(QLayout): |
|
|
|
if item.alignment() & Qt.AlignBottom: |
|
|
|
item_rect.moveBottom(contents.height() + content_margins.bottom()) |
|
|
|
else: |
|
|
|
item_rect.moveTop(content_margins.top() + (free_space.height() / 2)) |
|
|
|
item_rect.moveTop(content_margins.top() + (free_space.height() // 2)) |
|
|
|
else: |
|
|
|
item_rect.moveTop(content_margins.top()) |
|
|
|
|
|
|
@ -1224,10 +1224,10 @@ def QColorLerp(a: QColor, b: QColor, t: float): |
|
|
|
t = max(min(t, 1.0), 0.0) |
|
|
|
i_t = 1.0 - t |
|
|
|
return QColor( |
|
|
|
(a.red() * i_t) + (b.red() * t), |
|
|
|
(a.green() * i_t) + (b.green() * t), |
|
|
|
(a.blue() * i_t) + (b.blue() * t), |
|
|
|
(a.alpha() * i_t) + (b.alpha() * t), |
|
|
|
int((a.red() * i_t) + (b.red() * t)), |
|
|
|
int((a.green() * i_t) + (b.green() * t)), |
|
|
|
int((a.blue() * i_t) + (b.blue() * t)), |
|
|
|
int((a.alpha() * i_t) + (b.alpha() * t)), |
|
|
|
) |
|
|
|
|
|
|
|
|
|
|
|