mirror of
https://github.com/ynput/ayon-core.git
synced 2025-12-24 12:54:40 +01:00
use odd numbers for frame size
This commit is contained in:
parent
48d94b69fd
commit
6a57b4c450
1 changed files with 12 additions and 4 deletions
|
|
@ -328,6 +328,9 @@ class NiceCheckbox(QtWidgets.QFrame):
|
||||||
if frame_rect.width() < 0 or frame_rect.height() < 0:
|
if frame_rect.width() < 0 or frame_rect.height() < 0:
|
||||||
return
|
return
|
||||||
|
|
||||||
|
frame_rect.setLeft(frame_rect.x() + (frame_rect.width() % 2))
|
||||||
|
frame_rect.setTop(frame_rect.y() + (frame_rect.height() % 2))
|
||||||
|
|
||||||
painter = QtGui.QPainter(self)
|
painter = QtGui.QPainter(self)
|
||||||
|
|
||||||
painter.setRenderHint(QtGui.QPainter.Antialiasing)
|
painter.setRenderHint(QtGui.QPainter.Antialiasing)
|
||||||
|
|
@ -364,11 +367,16 @@ class NiceCheckbox(QtWidgets.QFrame):
|
||||||
margin_size_c = 0
|
margin_size_c = 0
|
||||||
|
|
||||||
checkbox_rect = QtCore.QRect(
|
checkbox_rect = QtCore.QRect(
|
||||||
frame_rect.x() + margin_size_c,
|
frame_rect.x(),
|
||||||
frame_rect.y() + margin_size_c,
|
frame_rect.y(),
|
||||||
frame_rect.width() - (margin_size_c * 2),
|
frame_rect.width(),
|
||||||
frame_rect.height() - (margin_size_c * 2)
|
frame_rect.height()
|
||||||
)
|
)
|
||||||
|
if margin_size_c:
|
||||||
|
checkbox_rect.adjust(
|
||||||
|
margin_size_c, margin_size_c,
|
||||||
|
-margin_size_c, -margin_size_c
|
||||||
|
)
|
||||||
|
|
||||||
if checkbox_rect.width() > checkbox_rect.height():
|
if checkbox_rect.width() > checkbox_rect.height():
|
||||||
radius = floor(checkbox_rect.height() * 0.5)
|
radius = floor(checkbox_rect.height() * 0.5)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue