Fix tileset editor grid layering
This commit is contained in:
parent
331dc1f5c4
commit
2fc906b5ae
2 changed files with 23 additions and 18 deletions
|
@ -42,6 +42,7 @@ private:
|
||||||
bool shouldAcceptEvent(QGraphicsSceneMouseEvent*);
|
bool shouldAcceptEvent(QGraphicsSceneMouseEvent*);
|
||||||
int numRows(int numMetatiles);
|
int numRows(int numMetatiles);
|
||||||
int numRows();
|
int numRows();
|
||||||
|
void drawGrid();
|
||||||
void drawFilters();
|
void drawFilters();
|
||||||
void drawUnused();
|
void drawUnused();
|
||||||
void drawCounts();
|
void drawCounts();
|
||||||
|
|
|
@ -69,9 +69,9 @@ QImage TilesetEditorMetatileSelector::buildImage(int metatileIdStart, int numMet
|
||||||
|
|
||||||
void TilesetEditorMetatileSelector::draw() {
|
void TilesetEditorMetatileSelector::draw() {
|
||||||
this->setPixmap(QPixmap::fromImage(this->buildAllMetatilesImage()));
|
this->setPixmap(QPixmap::fromImage(this->buildAllMetatilesImage()));
|
||||||
|
this->drawGrid();
|
||||||
this->drawSelection();
|
this->drawSelection();
|
||||||
|
this->drawFilters();
|
||||||
drawFilters();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bool TilesetEditorMetatileSelector::select(uint16_t metatileId) {
|
bool TilesetEditorMetatileSelector::select(uint16_t metatileId) {
|
||||||
|
@ -166,8 +166,10 @@ QPoint TilesetEditorMetatileSelector::getMetatileIdCoordsOnWidget(uint16_t metat
|
||||||
return pos;
|
return pos;
|
||||||
}
|
}
|
||||||
|
|
||||||
void TilesetEditorMetatileSelector::drawFilters() {
|
void TilesetEditorMetatileSelector::drawGrid() {
|
||||||
if (this->showGrid) {
|
if (!this->showGrid)
|
||||||
|
return;
|
||||||
|
|
||||||
QPixmap pixmap = this->pixmap();
|
QPixmap pixmap = this->pixmap();
|
||||||
QPainter painter(&pixmap);
|
QPainter painter(&pixmap);
|
||||||
const int numColumns = this->numMetatilesWide;
|
const int numColumns = this->numMetatilesWide;
|
||||||
|
@ -182,7 +184,9 @@ void TilesetEditorMetatileSelector::drawFilters() {
|
||||||
}
|
}
|
||||||
painter.end();
|
painter.end();
|
||||||
this->setPixmap(pixmap);
|
this->setPixmap(pixmap);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void TilesetEditorMetatileSelector::drawFilters() {
|
||||||
if (selectorShowUnused) {
|
if (selectorShowUnused) {
|
||||||
drawUnused();
|
drawUnused();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue