|
@@ -370,12 +370,12 @@ Gfx::IntRect TextEditor::gutter_content_rect(size_t line_index) const
|
|
|
|
|
|
Gfx::IntRect TextEditor::ruler_rect_in_inner_coordinates() const
|
|
|
{
|
|
|
- return { gutter_width(), 0, ruler_width(), height() - height_occupied_by_horizontal_scrollbar() };
|
|
|
+ return { gutter_width(), 0, ruler_width(), widget_inner_rect().height() };
|
|
|
}
|
|
|
|
|
|
Gfx::IntRect TextEditor::gutter_rect_in_inner_coordinates() const
|
|
|
{
|
|
|
- return { 0, 0, gutter_width(), height() - height_occupied_by_horizontal_scrollbar() };
|
|
|
+ return { 0, 0, gutter_width(), widget_inner_rect().height() };
|
|
|
}
|
|
|
|
|
|
Gfx::IntRect TextEditor::visible_text_rect_in_inner_coordinates() const
|
|
@@ -474,19 +474,8 @@ void TextEditor::paint_event(PaintEvent& event)
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- auto text_left = 0;
|
|
|
- if (m_ruler_visible)
|
|
|
- text_left = ruler_rect_in_inner_coordinates().right() + 1;
|
|
|
- else if (m_gutter_visible)
|
|
|
- text_left = gutter_rect_in_inner_coordinates().right() + 1;
|
|
|
- text_left += frame_thickness();
|
|
|
-
|
|
|
- Gfx::IntRect text_clip_rect {
|
|
|
- 0,
|
|
|
- frame_thickness(),
|
|
|
- width() - width_occupied_by_vertical_scrollbar() - text_left,
|
|
|
- height() - height_occupied_by_horizontal_scrollbar()
|
|
|
- };
|
|
|
+ auto gutter_ruler_width = gutter_width() + ruler_width();
|
|
|
+ Gfx::IntRect text_clip_rect { 0, 0, widget_inner_rect().width() - gutter_ruler_width, widget_inner_rect().height() };
|
|
|
text_clip_rect.translate_by(horizontal_scrollbar().value(), vertical_scrollbar().value());
|
|
|
painter.add_clip_rect(text_clip_rect);
|
|
|
|