Store aspect_ratio instead of weird proportional_{width,height} (Thanks phillip)

This commit only goes to “next” because I am not sure whether it
actually makes things better in all cases and want to give it some
testing first.

There was no documented reason behind using the
proportional_{width,height} variables, so I suppose that code was just
stupidity on my part (it was written merely a month after I started this
project in 2009).

fixes 
This commit is contained in:
Michael Stapelberg
2013-06-29 23:11:54 +02:00
parent c4d4418745
commit f55b7977e8
4 changed files with 15 additions and 19 deletions

@ -172,13 +172,14 @@ void render_con(Con *con, bool render_fullscreen) {
* Ignoring aspect ratio during fullscreen was necessary to fix MPlayer
* subtitle rendering, see http://bugs.i3wm.org/594 */
if (!render_fullscreen &&
con->proportional_height != 0 &&
con->proportional_width != 0) {
con->aspect_ratio > 0.0) {
DLOG("aspect_ratio = %f, current width/height are %d/%d\n",
con->aspect_ratio, inset->width, inset->height);
double new_height = inset->height + 1;
int new_width = inset->width;
while (new_height > inset->height) {
new_height = ((double)con->proportional_height / con->proportional_width) * new_width;
new_height = (1.0 / con->aspect_ratio) * new_width;
if (new_height > inset->height)
new_width--;