Commit a4378f44 authored by Huw Davies's avatar Huw Davies Committed by Alexandre Julliard

riched20: Move the range clamping to the helper now that the range isn't used later on.

parent 79278497
......@@ -304,7 +304,8 @@ static void draw_space( ME_Context *c, ME_Run *run, int x, int y,
static void get_selection_rect( ME_Context *c, ME_Run *run, int from, int to, int cy, RECT *r )
{
from = max( 0, from );
to = min( run->len, to );
r->left = ME_PointFromCharContext( c, run, from );
r->top = 0;
r->right = ME_PointFromCharContext( c, run, to );
......@@ -349,8 +350,6 @@ static void ME_DrawTextWithStyle(ME_Context *c, ME_Run *run, int x, int y, LPCWS
if (selected)
{
nSelFrom = max( 0, nSelFrom );
nSelTo = min( run->len, nSelTo );
get_selection_rect( c, run, nSelFrom, nSelTo, cy, &sel_rect );
OffsetRect( &sel_rect, x, ymin );
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment