Vincent Povirk madewokherd@gmail.com wrote:
GetTextExtentExPointW(hdc, string + index, range_start - index, INT_MAX, NULL, NULL, &range_size);
range_rect.X = bounds->X + range_size.cx;
range_rect.X = bounds->X / args->rel_width + range_size.cx; GetTextExtentExPointW(hdc, string + index, range_end - index, INT_MAX, NULL, NULL, &range_size);
range_rect.Width = (bounds->X + range_size.cx) - range_rect.X;
range_rect.Width = (bounds->X / args->rel_width + range_size.cx) - range_rect.X;
Shouldn't you be scaling range_size.cx as well?
No, range_size is already in pixels.