Giter VIP home page Giter VIP logo

Comments (3)

JanosGit avatar JanosGit commented on August 17, 2024 1

Thanks for verifying that!

I just pushed an according change that should fix it a87c33d

from resvg4juce.

JanosGit avatar JanosGit commented on August 17, 2024

Thank you for bringing that up. I just did a quick test on macOS on my MacBook Pro with a high res Retina display. Here the current scale computation correctly returns a scale factor of 2.0 which is expected, while getApproximateScaleFactorForComponent() returns 1.0.

If I get all that right, the correct approach will probably be multiplying both scale factors to retrieve the overall correct scale factor? It's been a while since I wrote this code, but I vaguely remember that I also got non 1.0 scale factors on Windows in some scenarios, so I would at least want to do some tests if this addition would not break anything in my Windows test environment before adding this. Will try to test that as soon as possible

from resvg4juce.

kauwua avatar kauwua commented on August 17, 2024

I think multiplying the scale factors would be better indeed. I tested my plugin in Standalone mode, and the original scale factor juce::Desktop::getInstance().getDisplays().getDisplayForPoint(getBounds().getCentre())->scale was 2.5 and getApproximateScaleFactorForComponent(this) was 1 . It seems that the original code is working, except for hosted VST plugins on Windows.

Multiplying both of them would take into account the display scale factor, and the additional transforms applied to the component (like Desktop::getInstance().getGlobalScaleFactor(), or the scaling factor applied on VSTs on Windows) https://github.com/Riuzakiii/Resvg4JUCE/commit/0ff91eb34e9f45543254d24f586450988b455fcc .

from resvg4juce.

Related Issues (3)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.