fix issues in single line mode of new text_editor
wrong caret and text position in single line mode
This commit is contained in:
parent
d34806353e
commit
fdf3753961
@ -1377,11 +1377,12 @@ namespace nana{ namespace widgets
|
|||||||
impl_->capacities.behavior = new behavior_linewrapped(*this);
|
impl_->capacities.behavior = new behavior_linewrapped(*this);
|
||||||
text_area_.vscroll = text_area_.scroll_pixels;
|
text_area_.vscroll = text_area_.scroll_pixels;
|
||||||
text_area_.hscroll = 0;
|
text_area_.hscroll = 0;
|
||||||
impl_->capacities.behavior->pre_calc_lines(width_pixels());
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
impl_->capacities.behavior = new behavior_normal(*this);
|
impl_->capacities.behavior = new behavior_normal(*this);
|
||||||
|
|
||||||
|
impl_->capacities.behavior->pre_calc_lines(width_pixels());
|
||||||
|
|
||||||
points_.offset.x = 0;
|
points_.offset.x = 0;
|
||||||
_m_offset_y(0);
|
_m_offset_y(0);
|
||||||
move_caret(upoint{});
|
move_caret(upoint{});
|
||||||
@ -2628,7 +2629,7 @@ namespace nana{ namespace widgets
|
|||||||
else
|
else
|
||||||
scrpos.x += _m_text_x(*sct_ptr);
|
scrpos.x += _m_text_x(*sct_ptr);
|
||||||
|
|
||||||
scrpos.y = text_area_.area.y + static_cast<int>((lines - points_.offset.y) * line_height());
|
scrpos.y = this->_m_text_top_base() + static_cast<int>((lines - points_.offset.y) * line_height());
|
||||||
return scrpos;
|
return scrpos;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user