GRAPHICS: MACGUI: realloc surface after changing dims

This commit is contained in:
ysj1173886760 2021-06-29 20:36:41 +08:00 committed by Eugene Sandulenko
parent bd0da46c2f
commit 1945e3ec5c

View File

@ -229,8 +229,14 @@ void MacText::init() {
_textMaxHeight = 0;
_surface = nullptr;
if (!_fixedDims)
if (!_fixedDims) {
int right = _dims.right;
_dims.right = MAX<int>(_dims.right, _dims.left + _maxWidth + (2 * _border) + (2 * _gutter) + _shadow);
if (right != _dims.right) {
delete _composeSurface;
_composeSurface = new ManagedSurface(_dims.width(), _dims.height(), _wm->_pixelformat);
}
}
_selEnd = -1;
_selStart = -1;