Skip to content

Commit

Permalink
Save layer opacity when it isn't equal to 1
Browse files Browse the repository at this point in the history
  • Loading branch information
bjorn committed Nov 13, 2009
1 parent b5d5dda commit 4762091
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/tmxmapwriter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -231,12 +231,15 @@ void TmxMapWriter::writeLayerAttributes(QXmlStreamWriter &w, const Layer *layer)
QString::number(layer->height()));
const int x = layer->x();
const int y = layer->y();
const qreal opacity = layer->opacity();
if (x != 0)
w.writeAttribute(QLatin1String("x"), QString::number(x));
if (y != 0)
w.writeAttribute(QLatin1String("y"), QString::number(y));
if (!layer->isVisible())
w.writeAttribute(QLatin1String("visible"), QLatin1String("0"));
if (opacity != qreal(1))
w.writeAttribute(QLatin1String("opacity"), QString::number(opacity));
}

/**
Expand Down

0 comments on commit 4762091

Please sign in to comment.