Re: [dev] dwm: drw_draw does too much

From: Hiltjo Posthuma <hiltjo_AT_codemadness.org>
Date: Sat, 28 Nov 2015 23:19:00 +0100

On Fri, Nov 27, 2015 at 8:18 PM, David Kennedy <dave-kennedy_AT_outlook.com> wrote:
> ... snip ...
>
> In other words, before calling drw_text (which needs to know the width of the thing to be drawn) on line 739, we call drw_text with no parameters on line 733 to get the width of the thing to be drawn.
>
> I think it would be better if another function was defined to get the width, and drw_text only had to draw the text. Then w could be a required parameter.
>

I agree, but keep in mind drw_text also handles fallback fonts, so it
calculates the width for it if needed. I'll accept a patch if it makes
the code simpler though ofcourse.

> Then again, drw_font_getexts_width already exists and could be used for this purpose. But it overlaps the functionality provided by drw_font_getexts. Maybe drw_font_getexts should be used wherever pixel dimensions are required.
>
> Thoughts? Should I just submit a patch?

Yes
Received on Sat Nov 28 2015 - 23:19:00 CET

This archive was generated by hypermail 2.3.0 : Sat Nov 28 2015 - 23:24:09 CET