Combine addRect and addRectFilled, add color checking

This commit is contained in:
GriffinR
2022-10-11 13:30:27 -04:00
committed by Marcus Huderle
parent 385c17fd23
commit 77d04bb6de
4 changed files with 71 additions and 52 deletions

View File

@@ -148,18 +148,18 @@ void MapView::setOpacity(int opacity) {
}
void MapView::addText(QString text, int x, int y, QString color, int fontSize, int layer) {
this->getOverlay(layer)->addText(text, x, y, color, fontSize);
this->scene()->update();
if (this->getOverlay(layer)->addText(text, x, y, color, fontSize))
this->scene()->update();
}
void MapView::addRect(int x, int y, int width, int height, QString color, int layer) {
this->getOverlay(layer)->addRect(x, y, width, height, color, false);
this->scene()->update();
void MapView::addRect(int x, int y, int width, int height, QString borderColor, QString fillColor, int layer) {
if (this->getOverlay(layer)->addRect(x, y, width, height, borderColor, fillColor))
this->scene()->update();
}
void MapView::addFilledRect(int x, int y, int width, int height, QString color, int layer) {
this->getOverlay(layer)->addRect(x, y, width, height, color, true);
this->scene()->update();
void MapView::addPath(QList<int> x, QList<int> y, QString color, int layer) {
if (this->getOverlay(layer)->addPath(x, y, color))
this->scene()->update();
}
void MapView::addImage(int x, int y, QString filepath, int layer, bool useCache) {
@@ -212,8 +212,3 @@ void MapView::addMetatileImage(int x, int y, int metatileId, bool setTransparenc
if (this->getOverlay(layer)->addImage(x, y, image))
this->scene()->update();
}
void MapView::addPath(QList<int> x, QList<int> y, QString color, int layer) {
if (this->getOverlay(layer)->addPath(x, y, color))
this->scene()->update();
}