2
0
mirror of https://github.com/kotatogram/kotatogram-desktop synced 2025-08-31 06:35:14 +00:00

Moved some photo editor files to td_ui.

This commit is contained in:
23rd
2022-01-10 08:14:40 +03:00
committed by John Preston
parent f8be5731a5
commit 39d5d3a1cf
4 changed files with 25 additions and 24 deletions

View File

@@ -86,8 +86,8 @@ void ItemCanvas::clearPixmap() {
_p = nullptr;
_pixmap = QPixmap(
(scene()->sceneRect().size() * cIntRetinaFactor()).toSize());
_pixmap.setDevicePixelRatio(cRetinaFactor());
(scene()->sceneRect().size() * style::DevicePixelRatio()).toSize());
_pixmap.setDevicePixelRatio(style::DevicePixelRatio());
_pixmap.fill(Qt::transparent);
_p = std::make_unique<Painter>(&_pixmap);
@@ -170,10 +170,10 @@ void ItemCanvas::handleMouseReleaseEvent(
if (_contentRect.isValid()) {
const auto scaledContentRect = QRectF(
_contentRect.x() * cRetinaFactor(),
_contentRect.y() * cRetinaFactor(),
_contentRect.width() * cRetinaFactor(),
_contentRect.height() * cRetinaFactor());
_contentRect.x() * style::DevicePixelRatio(),
_contentRect.y() * style::DevicePixelRatio(),
_contentRect.width() * style::DevicePixelRatio(),
_contentRect.height() * style::DevicePixelRatio());
_grabContentRequests.fire({
.pixmap = _pixmap.copy(scaledContentRect.toRect()),

View File

@@ -13,7 +13,7 @@ namespace Editor {
ItemLine::ItemLine(const QPixmap &&pixmap)
: _pixmap(std::move(pixmap))
, _rect(QPointF(), _pixmap.size() / cRetinaFactor()) {
, _rect(QPointF(), _pixmap.size() / float64(style::DevicePixelRatio())) {
}
QRectF ItemLine::boundingRect() const {