Merge lp:~3v1n0/unity/launcher-progressbar-offset-fix into lp:unity

Proposed by Marco Trevisan (Treviño)
Status: Merged
Approved by: Mirco Müller
Approved revision: 1813
Merged at revision: 1814
Proposed branch: lp:~3v1n0/unity/launcher-progressbar-offset-fix
Merge into: lp:unity
Diff against target: 12 lines (+1/-1)
1 file modified
plugins/unityshell/src/IconRenderer.cpp (+1/-1)
To merge this branch: bzr merge lp:~3v1n0/unity/launcher-progressbar-offset-fix
Reviewer Review Type Date Requested Status
Mirco Müller (community) Approve
Review via email:

Commit message

IconRenderer: make progress_y position relative to the fill_y, so they will be always close

Description of the change

Launcher icon progress overlay was drawn incorrectly when using odd icon size, due to the fact that we tried to draw both the fill and the progress in the middle of the icon. Now the middle position is computed only once for positioning the fill texture, then the progress texture is added to a position relative to their sizes.

To post a comment you must log in.
Revision history for this message
Mirco Müller (macslow) wrote :

Tried it with several different odd sizes. Working very nicely. It's all in the details! :)

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'plugins/unityshell/src/IconRenderer.cpp'
2--- plugins/unityshell/src/IconRenderer.cpp 2011-12-10 06:41:53 +0000
3+++ plugins/unityshell/src/IconRenderer.cpp 2012-01-04 01:50:27 +0000
4@@ -876,7 +876,7 @@
5 }
7 int fill_y = (height - fill_height) / 2;
8- int progress_y = (height - progress_height) / 2;
9+ int progress_y = fill_y + (fill_height - progress_height) / 2;
10 int half_size = (right_edge - left_edge) / 2;
12 SetOffscreenRenderTarget(texture);