OffScreenRendering disables touchpad scaling
Planned
I need touchpad to scale the JcefBrowser webpage content, but when I set OffScreenRendering to true, it won't responds to the pinch or scale event.
Why is that happened? Thank you very much for any help!
IDEA Ultimate 2024.3 on mac 14.5
Please sign in to leave a comment.
This happens in windowed mode because the browser receives native input events. It allows the browser to recognize zooming gestures by itself.
Our runtime at the moment doesn't have API that allows forwarding such events to the browser in the way it's expected. So it doesn't work out of the box. But it is still possible to some extent.
I can suggest to have a look into the implementation of zooming of SVG images. We have it in the platform codebase:
https://github.com/JetBrains/intellij-community/blob/master/images/src/org/intellij/images/editor/impl/jcef/JCefImageViewerUI.kt
Pls, have a look at the implementation of
com.intellij.ui.components.Magnificator
andcom.intellij.ui.components.ZoomableViewport