: p(parent), buffer_view_(0), lyx_view_(0),
caret_(0), caret_visible_(false),
need_resize_(false), preedit_lines_(1),
- pixel_ratio_(1.0),
+ last_pixel_ratio_(1.0),
completer_(new GuiCompleter(p, p)), dialog_mode_(false), shell_escape_(false),
read_only_(false), clean_(true), externally_modified_(false)
{
// LYXERR(Debug::PAINTING, "paintEvent begin: x: " << rc.x()
// << " y: " << rc.y() << " w: " << rc.width() << " h: " << rc.height());
- if (d->needResize()) {
+ if (d->need_resize_ || pixelRatio() != d->last_pixel_ratio_) {
d->resizeBufferView();
if (d->caret_visible_) {
d->hideCaret();
}
}
+ d->last_pixel_ratio_ = pixelRatio();
+
GuiPainter pain(viewport(), pixelRatio());
d->buffer_view_->draw(pain, d->caret_visible_);
void paintPreeditText(GuiPainter & pain);
- bool needResize() const {
- return need_resize_ || p->pixelRatio() != pixel_ratio_;
- }
-
///
GuiWorkArea * p;
///
/// Ratio between physical pixels and device-independent pixels
/// We save the last used value to detect changes of the
/// current pixel_ratio of the viewport.
- double pixel_ratio_;
+ double last_pixel_ratio_;
///
GuiCompleter * completer_;