Re: [dwm] 2 bugs in resize()

From: Anselm R Garbe <garbeam_AT_gmail.com>
Date: Sat, 23 Aug 2008 19:03:52 +0100

2008/8/23 Peter Hartlich <sgkkr_AT_hartlich.com>:
>> If y < x, then y / x < 1, whereas x / y > 1, afaik this might have
>> effect if we use c->mina as divisor later on.
>
> What kind of effect?

Well, wether having a very small height/width or a very big one,
depending on how mina has been calculated.

>>> If you apply only half the patch, then in
>>>
>>> | else if(a < c->mina)
>>> | h = w / c->mina;
>>>
>>> c->mina would have to be changed to 1.0/c->mina.
>>
>> Hmm, any reason why not restoring the previous h = w * c->mina instead?
>
> You would also need to correct the if statement's condition to
> "a < 1.0/c->mina" or "1.0/a > c->mina".
>
> But if you decide to stick with a reciprocal mina, I think completely
> reversing my patch, replacing > with < in the old code's mina check,
> and maybe renaming mina to rmina would be a cleaner way to go.

Yes, that's what I had in mind ;)

Kind regards,
--Anselm
Received on Sat Aug 23 2008 - 18:03:52 UTC

This archive was generated by hypermail 2.2.0 : Sat Aug 23 2008 - 18:12:04 UTC