⚠️ Forum Maintenance: Feb 6th, 8am - 14pm (UTC+2)

[SOLVED] Polygon with holes fading

  • I have managed to get a polygon with holes appearing. However the holes get darker and darker for some reason?

    Here is an example...

    !http://www.streettrack.co.uk/polygonhole.jpg(Example of polygon hold)!

    Here is the code:

    QPainterPath path;
    path.addPolygon(poly); // Outer region.
    if (v_polyinner.size() > 0)
    QPainterPath inner;
    for (int iPoly = 0; iPoly < v_polyinner.size(); iPoly++)
    path = path.subtracted(inner);

    stringstream sscolour;
    sscolour << "#" << polyi->getColour();
    QColor colour(QString::fromStdString(sscolour.str()));
    QBrush brush(colour);
    if (this->sSelectedItemGUID == polyi->getFeatureGUID()) painter.setPen(penHighlight);
    painter.fillPath(path, brush);

    It's seems as though as each polygon is added is goes darker.

  • Whoops, made a mistake loading the coordinates, so multiple polys were on top of each other and gradually fading the holes out.

Log in to reply