diff --git a/src/Magnum/Text/AbstractGlyphCache.cpp b/src/Magnum/Text/AbstractGlyphCache.cpp index d6c71d15f..d2da74479 100644 --- a/src/Magnum/Text/AbstractGlyphCache.cpp +++ b/src/Magnum/Text/AbstractGlyphCache.cpp @@ -314,10 +314,9 @@ UnsignedInt AbstractGlyphCache::addGlyph(const UnsignedInt fontId, const Unsigne "Text::AbstractGlyphCache::addGlyph(): glyph" << fontGlyphId << "in font" << fontId << "already added at index" << state.fontGlyphMapping[fontOffset + fontGlyphId], {}); /** @todo expand once rotations (and thus negative rectangle sizes) are supported */ - const Range2Di rectanglePadded = rectangle.padded(state.padding); #ifndef CORRADE_NO_ASSERT const Range2Dui rectangleu{rectangle}; - const Range2Dui rectanglePaddedu{rectanglePadded}; + const Range2Dui rectanglePaddedu{rectangle.padded(state.padding)}; #endif CORRADE_ASSERT(UnsignedInt(layer) < UnsignedInt(state.image.size().z()) && (rectangleu.min() <= rectangleu.max()).all() && (rectanglePaddedu.min() <= Vector2ui{state.image.size().xy()}).all() && (rectanglePaddedu.max() <= Vector2ui{state.image.size().xy()}).all(), "Text::AbstractGlyphCache::addGlyph(): layer" << layer << "and rectangle" << Debug::packed << rectangle << "out of range for size" << Debug::packed << state.image.size() << "and padding" << Debug::packed << state.padding, {}); diff --git a/src/Magnum/Text/DistanceFieldGlyphCache.cpp b/src/Magnum/Text/DistanceFieldGlyphCache.cpp index 9819232ea..7308bf74a 100644 --- a/src/Magnum/Text/DistanceFieldGlyphCache.cpp +++ b/src/Magnum/Text/DistanceFieldGlyphCache.cpp @@ -123,6 +123,9 @@ void DistanceFieldGlyphCache::doSetImage(const Vector2i& offset, const ImageView support border clamp, (c) required the input texture to have certain wrapping mode set */ CORRADE_INTERNAL_ASSERT(image.storage().skip().xy() == offset); + #ifdef CORRADE_NO_ASSERT + static_cast(offset); + #endif const Vector2i paddedMin = Math::max(Vector2i{0}, image.storage().skip().xy() - padding()); const Vector2i paddedMax = Math::min(size().xy(),