painter.begin(&pix_);
painter.setFont(config_.Font);
- if (!document->length()) {
+ if (!document_->length()) {
// TODO: draw Empty Background only
QBrush brush(config_.Colors[Color::Background]);
painter.fillRect(0, 0, width(), height(), brush);
}
Q_ASSERT(0 <= line_start);
- Q_ASSERT(static_cast<uint>(line_start) <= document->length() / HexConfig::Num + 1);
+ Q_ASSERT(static_cast<uint>(line_start) <= document_->length() / HexConfig::Num + 1);
Q_ASSERT(0 <= end);
- Q_ASSERT(static_cast<uint>(end) <= document->length() / HexConfig::Num + 1);
+ Q_ASSERT(static_cast<uint>(end) <= document_->length() / HexConfig::Num + 1);
// Get draw range
int y_top = config_.top();
// Get top position of view
const quint64 top = (cursor_->Top + line_start) * HexConfig::Num;
- const uint size = qMin(document->length() - top, (quint64)HexConfig::Num * count_draw_line);
+ const uint size = qMin(document_->length() - top, (quint64)HexConfig::Num * count_draw_line);
if (size == 0) {
return;
}
if (buff_.capacity() < size) {
buff_.resize(size);
}
- document->get(top, &buff_[0], size);
+ document_->get(top, &buff_[0], size);
// Get selectead area
bool selected = false;
const int y = config_.top() + config_.byteHeight() * (pos / HexConfig::Num - cursor_->Top);
// Draw shape
- drawCaretShape(CaretDrawInfo(painter, shape, pos, x, y, pos < document->length()));
+ drawCaretShape(CaretDrawInfo(painter, shape, pos, x, y, pos < document_->length()));
// Finish paint and update screen buffer
painter.end();
if (info.caret_middle) {
// Copy from document
uchar data;
- document->get(info.pos, &data, 1);
+ document_->get(info.pos, &data, 1);
info.hex.resize(2);
byteToHex(data, info.hex);
x = y = 0;
}
- return qMin((cursor_->Top + y) * HexConfig::Num + x, document->length());
+ return qMin((cursor_->Top + y) * HexConfig::Num + x, document_->length());
}
// Enable caret blink
break;
case Qt::Key_End:
cursor_->HighNibble = true;
- cursor_->movePosition(document->length(), keepAnchor, false);
+ cursor_->movePosition(document_->length(), keepAnchor, false);
break;
case Qt::Key_Left:
cursor_->HighNibble = true;