mirror of
https://github.com/huderlem/porymap.git
synced 2026-08-20 15:46:50 -05:00
Merge pull request #592 from GriffinRichards/fix-zoom
Misc fixes for selection images
This commit is contained in:
@@ -390,7 +390,9 @@ private:
|
||||
void openProjectSettingsEditor(int tab);
|
||||
bool isProjectOpen();
|
||||
void showExportMapImageWindow(ImageExporterMode mode);
|
||||
double getMetatilesZoomScale();
|
||||
void redrawMetatileSelection();
|
||||
void scrollMetatileSelectorToSelection();
|
||||
|
||||
QObjectList shortcutableObjects() const;
|
||||
void addCustomHeaderValue(QString key, QJsonValue value, bool isNew = false);
|
||||
|
||||
@@ -4,12 +4,23 @@
|
||||
#include <QGraphicsView>
|
||||
#include <QMouseEvent>
|
||||
|
||||
class ClickableGraphicsView : public QGraphicsView
|
||||
class NoScrollGraphicsView : public QGraphicsView
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
ClickableGraphicsView() : QGraphicsView() {}
|
||||
ClickableGraphicsView(QWidget *parent) : QGraphicsView(parent) {}
|
||||
NoScrollGraphicsView(QWidget *parent = nullptr) : QGraphicsView(parent) {}
|
||||
|
||||
protected:
|
||||
void wheelEvent(QWheelEvent *event) {
|
||||
event->ignore();
|
||||
}
|
||||
};
|
||||
|
||||
class ClickableGraphicsView : public NoScrollGraphicsView
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
ClickableGraphicsView(QWidget *parent = nullptr) : NoScrollGraphicsView(parent) {}
|
||||
|
||||
public:
|
||||
void mouseReleaseEvent(QMouseEvent *event) override {
|
||||
|
||||
@@ -45,13 +45,14 @@ public:
|
||||
QPoint getSelectionDimensions();
|
||||
void draw();
|
||||
bool select(uint16_t metatile);
|
||||
bool selectFromMap(uint16_t metatileId, uint16_t collision, uint16_t elevation);
|
||||
void selectFromMap(uint16_t metatileId, uint16_t collision, uint16_t elevation);
|
||||
void setTilesets(Tileset*, Tileset*);
|
||||
MetatileSelection getMetatileSelection();
|
||||
void setPrefabSelection(MetatileSelection selection);
|
||||
void setExternalSelection(int, int, QList<uint16_t>, QList<QPair<uint16_t, uint16_t>>);
|
||||
QPoint getMetatileIdCoordsOnWidget(uint16_t);
|
||||
void setMap(Map*);
|
||||
bool isInternalSelection() const { return (!this->externalSelection && !this->prefabSelection); }
|
||||
Tileset *primaryTileset;
|
||||
Tileset *secondaryTileset;
|
||||
protected:
|
||||
|
||||
Reference in New Issue
Block a user