Caleydo / caleydo

Caleydo - Visualization for Molecular Biology
http://caleydo.org
BSD 3-Clause "New" or "Revised" License
58 stars 14 forks source link

Add scaling factor to deal with high-res (retina) displays. #1435

Closed alexsb closed 11 years ago

alexsb commented 11 years ago

While the way of working with pixels is intuitive, the size of pixels are shrinking, so we do need to accommodate this.

Ideally we should introduce a scaling factor (float) that lets users dynamically up-scale the size of all pixel-specified elements.

Right now we do have two independent instances that convert pixels to gl cooridnates: PixelGLConverter for the old layouts, and the adaption of the view frustum for the new layout.

We quickly should check the feasibility of this simple solution and realize if it works immediately. Otherwise, we'll have to push this to later.

sgratzl commented 11 years ago

you are talking about simple scaling. Semantic scaling would be more interesting. That would mean we have to distinguish multiple units, similar to HTML: pt, px and %

alexsb commented 11 years ago

Well, the old layout uses % (or a more intelligent version of it even, % of non-statically allocated space). We definitely need something like this, but the current implementation shouldn't be influenced by the proposed change. Speaking in HTML terms: I'm suggesting to essentially abandon px and go to something like pt (i.e., size in cm), but also let users dynamically adjust this - since pt doesn't take viewing distance etc into account.

sgratzl commented 11 years ago

things that have to be considered:

sgratzl commented 11 years ago

in general we should move away from real pixels to e.g. Device-Independent-Pixels (DIPs).

That could be our new base unit.

sgratzl commented 11 years ago

checkout the new branch: develop_scaling -> everything should depend on the DPI + in addition within the preferences, one can apply an extra scaling factor

sgratzl commented 11 years ago

everything is now based on DIPs. That means pixelConverter.getPixel... won't return pixels but DIPs. The IGLCanvas is responsible for handling the DIPs.

in a similar fashion the whole GLElement layout are now based on DIPs. But if you need/want special scale, you can use the Units class, allowing converting from:

mstreit commented 11 years ago

That feature is awesome! It could even help when presenting Caleydo live on low res projectors. It's also nice for the DVI when many datasets are loaded.

sgratzl commented 11 years ago

warning: I don't know why but Display.getDPI will return 72 on the Mac, even its actually more than hundred. That means, that it will initially look too small. An alternative would be to compute the DPI by our own, but that would be monitor dependent.

alexsb commented 11 years ago

The pathway view makes some problems.

pathway

Specifically, the scrolling seems to be off.

sgratzl commented 11 years ago

the pathway stuff should be fixed.

As nobody else found bugs, I'm going to merge the branch into the develop tomorrow.

sgratzl commented 11 years ago

develop_scaling is now merged into the develop branch