mirror of
https://github.com/huderlem/porymap.git
synced 2026-09-17 13:26:01 -05:00
Add clipping capabilities to overlay scripting api
This commit is contained in:
@@ -79,6 +79,29 @@ void MapView::setY(int y) {
|
||||
this->scene()->update();
|
||||
}
|
||||
|
||||
void MapView::setClippingRect(int x, int y, int width, int height, int layer) {
|
||||
this->getOverlay(layer)->setClippingRect(QRectF(x, y, width, height));
|
||||
this->scene()->update();
|
||||
}
|
||||
|
||||
void MapView::setClippingRect(int x, int y, int width, int height) {
|
||||
QRectF rect = QRectF(x, y, width, height);
|
||||
foreach (Overlay * layer, this->overlayMap)
|
||||
layer->setClippingRect(rect);
|
||||
this->scene()->update();
|
||||
}
|
||||
|
||||
void MapView::clearClippingRect(int layer) {
|
||||
this->getOverlay(layer)->clearClippingRect();
|
||||
this->scene()->update();
|
||||
}
|
||||
|
||||
void MapView::clearClippingRect() {
|
||||
foreach (Overlay * layer, this->overlayMap)
|
||||
layer->clearClippingRect();
|
||||
this->scene()->update();
|
||||
}
|
||||
|
||||
QJSValue MapView::getPosition(int layer) {
|
||||
Overlay * overlay = this->getOverlay(layer);
|
||||
return Scripting::position(overlay->getX(), overlay->getY());
|
||||
|
||||
Reference in New Issue
Block a user