Commit MetaInfo

Revisiona29935fa6887ee93bc89cb7bb7d6fa0b61fd7036 (tree)
Time2017-07-28 22:06:26
Author <exeal@user...>

Log Message

fixed: TextRenderer.paint method might crash if there are no lines to paint.

Change Summary

Incremental Difference

diff -r 864bb714f2df -r a29935fa6887 ascension/src/graphics/font/text-renderer.cpp
--- a/ascension/src/graphics/font/text-renderer.cpp Fri Jul 28 21:25:10 2017 +0900
+++ b/ascension/src/graphics/font/text-renderer.cpp Fri Jul 28 22:06:26 2017 +0900
@@ -381,8 +381,10 @@
381381 // paint background outside of the lines
382382 {
383383 const presentation::FlowRelativeFourSides<graphics::Scalar> abstractOutside(
384- presentation::_blockStart = *boost::const_end(linesToPaint.back().extent), presentation::_blockEnd = std::numeric_limits<graphics::Scalar>::max(),
385- presentation::_inlineStart = std::numeric_limits<graphics::Scalar>::lowest(), presentation::_inlineEnd = std::numeric_limits<graphics::Scalar>::max()
384+ presentation::_blockStart = !boost::empty(linesToPaint) ? *boost::const_end(linesToPaint.back().extent) : 0,
385+ presentation::_blockEnd = std::numeric_limits<graphics::Scalar>::max(),
386+ presentation::_inlineStart = std::numeric_limits<graphics::Scalar>::lowest(),
387+ presentation::_inlineEnd = std::numeric_limits<graphics::Scalar>::max()
386388 );
387389 Rectangle physicalOutside;
388390 {
Show on old repository browser