Two scaling factor issues


#1

with my Monitor on Windows automatically scales to 125%

 

1. when using  an a window

void setContentOwned (Component* newContentComponent,   bool resizeToFitWhenContentChangesSize);

with resizeToFitWhenContentChangesSize=true

the window ill be to small (1/1.125) for its content

 

2. 

All thin lines around window-borders may one pixel to small so that background shines through. I now thats through the fact windows and components use integer coordinats, but maybe there should be a special paintComponentBorder() or something like this, which paints accourate lines arounds boxes.

PS: Browser build-in spell correction doesn't work in the new forum :(

 

 


#2

Thanks, will look into those…

(BTW the spelling correction does work if you edit in BBCode mode)


#3

i don’t now the exact mechanism, but it helps just to add
"if (contentComponent != nullptr) contentComponent->resized();"
add the end of ResizableWindow::setContent


#4

any idea, how can i calculate the zoom-factor, that a 10 pixel (aka juce coordinats) button, appears as 1cm on a mobil screen?

 


#5

Sorry, I hadn't looked at the content comp thing yet, will do soon.

TBH I don't think DPI figures are reliable on all devices - maybe on Android, but I vaguely remember that on iOS there's no way to really know the physical size.


#6

 

on iOS i guess based on various hack factors. on Android the DPI is *sometimes* rounded to "known" values (ie the compile time constants in the API). This causes things to be (usually) a bit bigger on some devices, when scaled to DPI.

 

 


#7

thanks 

 

two answer my self:

 

Desktop::getInstance().setGlobalScaleFactor((float)((Desktop::getInstance().getDisplays().getMainDisplay().dpi / 2.54) / pixelPerCentimeter) );


#8

when i set the GlobalScaling on Android, and then set the window to fullscreen, the window isn’t fullscreen anymore.

We need an working solution, to scale the fullscreen-apps to a level, that controls can be touched with fingers.
Even the Juce-Demo isn’t usable on my Samsung Galaxy Nexus (Google Phone), cause the controls are much too small.

If i use
Desktop::getInstance().setGlobalScaleFactor((float)((Desktop::getInstance().getDisplays().getMainDisplay().dpi / 2.54) / 30) );
my app even will crash


#9

bump