Skip to content

Scale ratio is set to 1 in MainWindow even if display size < target size #908

Open
@AlmasB

Description

@AlmasB

Describe the bug
If settings.isScaleAffectedOnResize is false, then we set:

            scaleRatioX.value = 1.0
            scaleRatioY.value = 1.0

if (settings.isScaleAffectedOnResize) {
if (settings.isPreserveResizeRatio) {
scaleRatioX.bind(Bindings.min(
scaledWidth.divide(settings.width), scaledHeight.divide(settings.height)
))
scaleRatioY.bind(scaleRatioX)
} else {
scaleRatioX.bind(scaledWidth.divide(settings.width))
scaleRatioY.bind(scaledHeight.divide(settings.height))
}
} else {
scaleRatioX.value = 1.0
scaleRatioY.value = 1.0

This can potentially be problematic if display size < target size

To Reproduce
Need to make a sample with target size set to larger than display size and set isScaleAffectedOnResize to false.

Additional context / possible fixes
Should be fixable by setting the above scale values based on display size / target size ratio?

To fix, first identify that this is indeed a bug and explain what happens in the above case.

Metadata

Metadata

Assignees

No one assigned

    Labels

    codefest23-24difficulty:mediumAPI design elements, need time to think throughhelp wantedContributions welcome / high PR acceptance rate

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions