On Thu,  4 Apr 2013 11:00:50 -0400
Jason Woofenden <[email protected]> wrote:

> ---
>  clients/terminal.c |    8 +++++---
>  1 file changed, 5 insertions(+), 3 deletions(-)
> 
> diff --git a/clients/terminal.c b/clients/terminal.c
> index e80e0e5..81edd25 100644
> --- a/clients/terminal.c
> +++ b/clients/terminal.c
> @@ -757,11 +757,13 @@ resize_handler(struct widget *widget,
>              int32_t width, int32_t height, void *data)
>  {
>       struct terminal *terminal = data;
> -     int32_t columns, rows, m;
> +     int32_t columns, rows, m, cell_w, cell_h;
>  
>       m = 2 * terminal->margin;
> -     columns = (width - m) / (int32_t) terminal->extents.max_x_advance;
> -     rows = (height - m) / (int32_t) terminal->extents.height;
> +     cell_w = (int32_t) terminal->extents.max_x_advance;
> +     cell_h = (int32_t) terminal->extents.height
> +     columns = (width - m + (cell_w / 2)) / cell_w;
> +     rows = (height - m + (cell_h / 2)) / cell_h;
>  
>       if (!window_is_fullscreen(terminal->window) &&
>           !window_is_maximized(terminal->window)) {
> -- 
> 1.7.10.4

Looks good to me.

We usually prefix the commit subject with a tag, like:
"terminal: tweak rounding on resize"

You could have also explained in the commit message body, why this
is a useful change.


Thanks,
pq
_______________________________________________
wayland-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/wayland-devel

Reply via email to