resolve some goofiness

This commit is contained in:
garak 2025-02-06 12:55:51 -05:00 committed by t
parent 1e7d5144b9
commit 51773926d2
7 changed files with 10 additions and 12 deletions

View File

@ -103,7 +103,7 @@ public:
void setBlock(int x, int y, Block block, bool enableScriptCallback = false);
void setBlockdata(Blockdata blockdata, bool enableScriptCallback = false);
void adjustDimensions(QMargins margins, bool setNewBlockdata = true, bool enableScriptCallback = false);
void adjustDimensions(QMargins margins, bool setNewBlockdata = true);
void setDimensions(int newWidth, int newHeight, bool setNewBlockdata = true, bool enableScriptCallback = false);
void setBorderDimensions(int newWidth, int newHeight, bool setNewBlockdata = true, bool enableScriptCallback = false);

View File

@ -59,7 +59,7 @@ public:
protected:
void hoverMoveEvent(QGraphicsSceneHoverEvent *event) override;
void hoverLeaveEvent(QGraphicsSceneHoverEvent *event) override;
void hoverLeaveEvent(QGraphicsSceneHoverEvent *) override;
void mousePressEvent(QGraphicsSceneMouseEvent *event) override;
void mouseMoveEvent(QGraphicsSceneMouseEvent *event) override;

View File

@ -214,7 +214,7 @@ void ResizeLayout::redo() {
layout->width = oldLayoutWidth;
layout->height = oldLayoutHeight;
layout->adjustDimensions(this->newLayoutMargins, false, true);
layout->adjustDimensions(this->newLayoutMargins);
layout->blockdata = newMetatiles;
layout->lastCommitBlocks.layoutDimensions = QSize(layout->getWidth(), layout->getHeight());
@ -231,7 +231,7 @@ void ResizeLayout::undo() {
layout->width = oldLayoutWidth + newLayoutMargins.left() + newLayoutMargins.right();
layout->height = oldLayoutHeight + newLayoutMargins.top() + newLayoutMargins.bottom();
layout->adjustDimensions(-this->newLayoutMargins, false, true);
layout->adjustDimensions(-this->newLayoutMargins);
layout->blockdata = oldMetatiles;
layout->lastCommitBlocks.layoutDimensions = QSize(layout->getWidth(), layout->getHeight());

View File

@ -176,14 +176,14 @@ void Layout::setDimensions(int newWidth, int newHeight, bool setNewBlockdata, bo
emit layoutDimensionsChanged(QSize(getWidth(), getHeight()));
}
void Layout::adjustDimensions(QMargins margins, bool setNewBlockdata, bool enableScriptCallback) {
void Layout::adjustDimensions(QMargins margins, bool setNewBlockdata) {
int oldWidth = this->width;
int oldHeight = this->height;
int newWidth = this->width + margins.left() + margins.right();
int newHeight = this->height + margins.top() + margins.bottom();
if (setNewBlockdata) {
// Fill new blockdata TODO: replace old functions, scripting support, undo etc
// Fill new blockdata
Blockdata newBlockdata;
for (int y = 0; y < newHeight; y++)
for (int x = 0; x < newWidth; x++) {

View File

@ -2625,8 +2625,6 @@ void MainWindow::on_pushButton_ChangeDimensions_clicked() {
));
}
}
return;
}
void MainWindow::on_checkBox_smartPaths_stateChanged(int selected)

View File

@ -104,7 +104,7 @@ void ResizableRect::hoverMoveEvent(QGraphicsSceneHoverEvent *event) {
}
}
void ResizableRect::hoverLeaveEvent(QGraphicsSceneHoverEvent *event) {
void ResizableRect::hoverLeaveEvent(QGraphicsSceneHoverEvent *) {
this->unsetCursor();
}

View File

@ -46,7 +46,7 @@ BoundedPixmapItem::BoundedPixmapItem(const QPixmap &pixmap, QGraphicsItem *paren
setFlags(this->flags() | QGraphicsItem::ItemIsMovable | QGraphicsItem::ItemSendsGeometryChanges | QGraphicsItem::ItemIsSelectable);
}
void BoundedPixmapItem::paint(QPainter *painter, const QStyleOptionGraphicsItem * item, QWidget *widget) {
void BoundedPixmapItem::paint(QPainter *painter, const QStyleOptionGraphicsItem *, QWidget *) {
// Draw the pixmap darkened in the background
painter->fillRect(this->boundingRect().toAlignedRect(), QColor(0x444444));
painter->setCompositionMode(QPainter::CompositionMode_Multiply);
@ -140,8 +140,8 @@ void ResizeLayoutPopup::setupLayoutView() {
this->ui->spinBox_height->setMinimum(1);
this->ui->spinBox_height->setMaximum(maxHeight);
this->ui->spinBox_width->setLineEditEnabled(false);
this->ui->spinBox_height->setLineEditEnabled(false);
//this->ui->spinBox_width->setLineEditEnabled(false);
//this->ui->spinBox_height->setLineEditEnabled(false);
static bool layoutSizeRectVisible = true;