Chunkmogrify icon indicating copy to clipboard operation
Chunkmogrify copied to clipboard

fixed a bug, dont have time for pull request tho atm

Open 2blackbar opened this issue 1 year ago • 0 comments

in workspace.py , this is new version

def resizeEvent(self, event):
    w, h = event.size().width(), event.size().height()

    if w / h > self.ar:
        self.layout().setDirection(QBoxLayout.LeftToRight)
        widget_stretch = h * self.ar
        outer_stretch = (w - widget_stretch) / 2 + 0.5
    else:
        self.layout().setDirection(QBoxLayout.TopToBottom)
        widget_stretch = w / self.ar
        outer_stretch = (h - widget_stretch) / 2 + 0.5

    self.layout().setStretch(0, int(outer_stretch))
    self.layout().setStretch(1, int(widget_stretch))
    self.layout().setStretch(2, int(outer_stretch))

this was the bug

File "F:\Chunk\widgets\workspace.py", line 40, in resizeEvent self.layout().setStretch(0, outer_stretch) TypeError: setStretch(self, index: int, stretch: int): argument 2 has unexpected type 'float'

looks like theres more

2blackbar avatar Apr 05 '23 14:04 2blackbar