Scale to qreal, draw path border over fill
This commit is contained in:
parent
82dcecf8f2
commit
d88d6a828e
4 changed files with 21 additions and 21 deletions
|
@ -44,12 +44,12 @@ public:
|
|||
Q_INVOKABLE int getOpacity(int layer = 0);
|
||||
Q_INVOKABLE void setOpacity(int opacity, int layer);
|
||||
Q_INVOKABLE void setOpacity(int opacity);
|
||||
Q_INVOKABLE int getHorizontalScale(int layer = 0);
|
||||
Q_INVOKABLE int getVerticalScale(int layer = 0);
|
||||
Q_INVOKABLE void setHorizontalScale(int scale, int layer);
|
||||
Q_INVOKABLE void setHorizontalScale(int scale);
|
||||
Q_INVOKABLE void setVerticalScale(int scale, int layer);
|
||||
Q_INVOKABLE void setVerticalScale(int scale);
|
||||
Q_INVOKABLE qreal getHorizontalScale(int layer = 0);
|
||||
Q_INVOKABLE qreal getVerticalScale(int layer = 0);
|
||||
Q_INVOKABLE void setHorizontalScale(qreal scale, int layer);
|
||||
Q_INVOKABLE void setHorizontalScale(qreal scale);
|
||||
Q_INVOKABLE void setVerticalScale(qreal scale, int layer);
|
||||
Q_INVOKABLE void setVerticalScale(qreal scale);
|
||||
Q_INVOKABLE int getAngle(int layer = 0);
|
||||
Q_INVOKABLE void setAngle(int angle, int layer);
|
||||
Q_INVOKABLE void setAngle(int angle);
|
||||
|
|
|
@ -88,10 +88,10 @@ public:
|
|||
int getY();
|
||||
void setX(int x);
|
||||
void setY(int y);
|
||||
int getHScale();
|
||||
int getVScale();
|
||||
void setHScale(int scale);
|
||||
void setVScale(int scale);
|
||||
qreal getHScale();
|
||||
qreal getVScale();
|
||||
void setHScale(qreal scale);
|
||||
void setVScale(qreal scale);
|
||||
int getAngle();
|
||||
void setAngle(int angle);
|
||||
void rotate(int degrees);
|
||||
|
|
|
@ -147,33 +147,33 @@ void MapView::setOpacity(int opacity) {
|
|||
this->scene()->update();
|
||||
}
|
||||
|
||||
int MapView::getHorizontalScale(int layer) {
|
||||
qreal MapView::getHorizontalScale(int layer) {
|
||||
return this->getOverlay(layer)->getHScale();
|
||||
}
|
||||
|
||||
int MapView::getVerticalScale(int layer) {
|
||||
qreal MapView::getVerticalScale(int layer) {
|
||||
return this->getOverlay(layer)->getVScale();
|
||||
}
|
||||
|
||||
void MapView::setHorizontalScale(int scale, int layer) {
|
||||
void MapView::setHorizontalScale(qreal scale, int layer) {
|
||||
this->getOverlay(layer)->setHScale(scale);
|
||||
this->scene()->update();
|
||||
}
|
||||
|
||||
// Overload. No layer provided, set horizontal scale of all layers
|
||||
void MapView::setHorizontalScale(int scale) {
|
||||
void MapView::setHorizontalScale(qreal scale) {
|
||||
foreach (Overlay * layer, this->overlayMap)
|
||||
layer->setHScale(scale);
|
||||
this->scene()->update();
|
||||
}
|
||||
|
||||
void MapView::setVerticalScale(int scale, int layer) {
|
||||
void MapView::setVerticalScale(qreal scale, int layer) {
|
||||
this->getOverlay(layer)->setVScale(scale);
|
||||
this->scene()->update();
|
||||
}
|
||||
|
||||
// Overload. No layer provided, set vertical scale of all layers
|
||||
void MapView::setVerticalScale(int scale) {
|
||||
void MapView::setVerticalScale(qreal scale) {
|
||||
foreach (Overlay * layer, this->overlayMap)
|
||||
layer->setVScale(scale);
|
||||
this->scene()->update();
|
||||
|
|
|
@ -11,9 +11,9 @@ void OverlayText::render(QPainter *painter) {
|
|||
}
|
||||
|
||||
void OverlayPath::render(QPainter *painter) {
|
||||
painter->fillPath(this->path, this->fillColor);
|
||||
painter->setPen(this->borderColor);
|
||||
painter->drawPath(this->path);
|
||||
painter->fillPath(this->path, this->fillColor);
|
||||
}
|
||||
|
||||
void OverlayImage::render(QPainter *painter) {
|
||||
|
@ -90,19 +90,19 @@ void Overlay::setY(int y) {
|
|||
this->y = y;
|
||||
}
|
||||
|
||||
int Overlay::getHScale() {
|
||||
qreal Overlay::getHScale() {
|
||||
return this->hScale;
|
||||
}
|
||||
|
||||
int Overlay::getVScale() {
|
||||
qreal Overlay::getVScale() {
|
||||
return this->vScale;
|
||||
}
|
||||
|
||||
void Overlay::setHScale(int scale) {
|
||||
void Overlay::setHScale(qreal scale) {
|
||||
this->hScale = scale;
|
||||
}
|
||||
|
||||
void Overlay::setVScale(int scale) {
|
||||
void Overlay::setVScale(qreal scale) {
|
||||
this->vScale = scale;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue