SoShapeScale: Fix SoShapeScale does not take DPI scaling into account
This commit is contained in:
@@ -51,11 +51,10 @@
|
||||
#endif
|
||||
|
||||
#include "SoAxisCrossKit.h"
|
||||
|
||||
#include "SoDevicePixelRatioElement.h"
|
||||
|
||||
using namespace Gui;
|
||||
|
||||
|
||||
SO_KIT_SOURCE(SoShapeScale)
|
||||
|
||||
// Constructor.
|
||||
@@ -101,6 +100,9 @@ SoShapeScale::GLRender(SoGLRenderAction * action)
|
||||
float nsize = this->scaleFactor.getValue() / float(vp.getViewportSizePixels()[0]);
|
||||
SoModelMatrixElement::get(state).multVecMatrix(center, center); // world coords
|
||||
float sf = vv.getWorldToScreenScale(center, nsize);
|
||||
|
||||
sf *= SoDevicePixelRatioElement::get(state);
|
||||
|
||||
SbVec3f v(sf, sf, sf);
|
||||
if (scale->scaleFactor.getValue() != v){
|
||||
scale->scaleFactor = v;
|
||||
|
||||
Reference in New Issue
Block a user