- //long top = text->sel_start_cursor.y
- // - text->sel_start_cursor.row->baseline;
- //long bottom = text->sel_end_cursor.y
- // - text->sel_end_cursor.row->baseline
- // + text->sel_end_cursor.row->height;
-
- //top = max(top, first);
- //bottom = max(bottom, first);
-
- //bottom = min(max(bottom, first), first + owner.height());
- //top = min(max(top, first), first + owner.height());
- long bottom = min(max(text->sel_end_cursor.y
- - text->sel_end_cursor.row->baseline
- + text->sel_end_cursor.row->height, first),
- first + owner.height());
- long top = min(max(text->sel_start_cursor.y
- - text->sel_start_cursor.row->baseline, first),
- first + owner.height());
+ int const bottom = min(
+ max(static_cast<int>(text->sel_end_cursor.y()
+ - text->sel_end_cursor.row()->baseline()
+ + text->sel_end_cursor.row()->height()),
+ text->first),
+ static_cast<int>(text->first + owner.height()));
+ int const top = min(
+ max(static_cast<int>(text->sel_start_cursor.y() -
+ text->sel_start_cursor.row()->baseline()),
+ text->first),
+ static_cast<int>(text->first + owner.height()));