[PATCH 1/2] comctl32/listbox: Don't try to paint non-visible items for multi-column listboxes
Gabriel Ivăncescu
gabrielopcode at gmail.com
Mon May 20 07:29:31 CDT 2019
On 5/20/19 3:24 PM, Nikolay Sivov wrote:
> On 4/22/19 3:32 PM, Gabriel Ivăncescu wrote:
>
>> Signed-off-by: Gabriel Ivăncescu <gabrielopcode at gmail.com>
>> ---
>>
>> Currently the early break happens only with single-column listboxes. This
>> makes it so that it works properly with multi-column listboxes as well.
>>
>> dlls/comctl32/listbox.c | 1 +
>> 1 file changed, 1 insertion(+)
>>
>> diff --git a/dlls/comctl32/listbox.c b/dlls/comctl32/listbox.c
>> index bd9cffd..69fa56a 100644
>> --- a/dlls/comctl32/listbox.c
>> +++ b/dlls/comctl32/listbox.c
>> @@ -1149,6 +1149,7 @@ static LRESULT LISTBOX_Paint( LB_DESCR *descr,
>> HDC hdc )
>> rect.right += descr->column_width;
>> rect.top = 0;
>> col_pos = descr->page_size - 1;
>> + if (rect.left >= descr->width) break;
>> }
>> else
>> {
> How does this work for RTL case?Existing optimization for single column
> case is testing in vertical direction, so it's not the same.
>
>
Hi Nikolay,
I think it works fine since the coordinates are mirrored (i.e.
increasing means going left). Because the code already does rect.right
+= descr->column_width; just above that, so that line would be wrong
already if it didn't work in RTL. (it would paint items in the wrong order)
More information about the wine-devel
mailing list