Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Redesign Dimension Change Window #637

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

garakmon
Copy link
Collaborator

@garakmon garakmon commented Nov 12, 2024

TODOs:

  • bound limits
  • scriptability
  • reset() functionality

closes #616

Comment on lines -3007 to -3020
int numMetatiles = editor->project->getMapDataSize(widthSpinBox->value(), heightSpinBox->value());
int maxMetatiles = editor->project->getMaxMapDataSize();
if (numMetatiles <= maxMetatiles) {
dialog.accept();
} else {
QString errorText = QString("Error: The specified width and height are too large.\n"
"The maximum layout width and height is the following: (width + 15) * (height + 14) <= %1\n"
"The specified layout width and height was: (%2 + 15) * (%3 + 14) = %4")
.arg(maxMetatiles)
.arg(widthSpinBox->value())
.arg(heightSpinBox->value())
.arg(numMetatiles);
errorLabel->setText(errorText);
errorLabel->setVisible(true);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This error check wasn't re-implemented (at least not that I can see)

Comment on lines +186 to +188
void Layout::adjustDimensions(QMargins margins, bool setNewBlockdata, bool enableScriptCallback) {
int oldWidth = this->width;
int oldHeight = this->height;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Warnings here for enableScriptCallback and oldHeight being unused

}
}

void ResizableRect::hoverLeaveEvent(QGraphicsSceneHoverEvent *event) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
void ResizableRect::hoverLeaveEvent(QGraphicsSceneHoverEvent *event) {
void ResizableRect::hoverLeaveEvent(QGraphicsSceneHoverEvent *) {

setFlags(this->flags() | QGraphicsItem::ItemIsMovable | QGraphicsItem::ItemSendsGeometryChanges | QGraphicsItem::ItemIsSelectable);
}

void BoundedPixmapItem::paint(QPainter *painter, const QStyleOptionGraphicsItem * item, QWidget *widget) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
void BoundedPixmapItem::paint(QPainter *painter, const QStyleOptionGraphicsItem * item, QWidget *widget) {
void BoundedPixmapItem::paint(QPainter *painter, const QStyleOptionGraphicsItem *, QWidget *) {

Comment on lines +144 to +145
this->ui->spinBox_width->setLineEditEnabled(false);
this->ui->spinBox_height->setLineEditEnabled(false);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why are we disabling line editing for these? (and for spinBox_borderWidth/Height)

int newHeight = this->height + margins.top() + margins.bottom();

if (setNewBlockdata) {
// Fill new blockdata TODO: replace old functions, scripting support, undo etc
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Aside from scripting is the rest of this still true?

Comment on lines +2988 to +2989

return;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Left behind

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Feature Request] Allow resizing maps from different sides. Add preview for it.
2 participants