01-31-2023, 09:56 AM
scaleFactor = int(maxSize) / int(currentWidth) is returning zero because you're doing integer arithmetic. You need to make one or both into float values to get a fractional scaleFactor
Code:
> > > int(512) / int(258)
1
> > > int(512) / float(258)
1.9844961240310077