Skip to main content
New Participant
October 27, 2019
Question

Using canvas in Adobe CEP

  • October 27, 2019
  • 2 replies
  • 529 views

Hi,

 

I'm doing some tests rendering WebGL stuff inside Illustrator. It works, but everything in the canvas is scaled at 1.25, i.e. everything seems 25% larger. I'm attaching an image that shows the same thing being rendered in Chrome (background) and in Adobe CEP (foreground).

 

Any idea on what's going on?

 

Thanks in advance,

Alex

    This topic has been closed for replies.

    2 replies

    Ten A
    Adobe Expert
    October 27, 2019

    You can use getScaleFactor method.

    var csi = new CSInterface();
    alert(csi.getScaleFactor());

     

    New Participant
    October 28, 2019

    Thank you!

    Mylenium
    Brainiac
    October 27, 2019

    Sounds perfectly normal. All such panels respond to the apps' DPI settings, in particular on high-DPI screens and Adobe has some own ideas on what values they deem correct. You may need to add some extra math to compensate for that and make it behave more like a web browser at the risk of breaking compatibility for users.

     

    Mylenium

    New Participant
    October 27, 2019

    Thank you.

     

    In Preferences->User Interface->UI Scaling, there is a UI Scaling slider, that scales everything.

     

    My problem now is how to get that scaling. In the canvas, clientWidth and clientHeight are always equal to width and height respectively, even when the UI Scaling property changes.

     

    Is there a programatic way of finding out what the UI Scaling is?