-
-
Notifications
You must be signed in to change notification settings - Fork 35.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
WebGLRenderer: added getPhysicalSize() #11374
Conversation
I prefer |
Does the renderer's "size" have any meaning that is useful? |
Um, good question 🤔 ! Let me think about this 😊 |
What's the terminology used when dealing with css? |
In the context of CSS and the
see https://stackoverflow.com/questions/8785643/what-exactly-is-device-pixel-ratio But i'm not sure if this terminology is appropriate for a 3D library. |
It's a 3d library that exclusively renders to an element that already has a nomenclature in place. Makes sense for this to be as close to the terminology used in canvas/dom as possible? |
|
src/renderers/WebGLRenderer.js
Outdated
@@ -415,6 +415,15 @@ function WebGLRenderer( parameters ) { | |||
|
|||
}; | |||
|
|||
this.getPhysicalSize = function () { | |||
|
|||
return { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How about:
return {
width: _width * _pixelRatio,
height: _height * _pixelRatio
};
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK.
Done! |
Many thanks! |
Actually, this method could be renamed to
getDrawingBufferSize()
, as opposed to using the physical/logical nomenclature.Also, I updated the docs. Those changes may be up for discussion, too.
This PR was posted in response to #10238 (comment).