Commit 7e324283 authored by Clément Fauconnier's avatar Clément Fauconnier

fixed an issue where font family styles of a block with the same font family...

fixed an issue where font family styles of a block with the same font family were lost when changing size
parent 1e78d64d
......@@ -630,7 +630,15 @@ void UBGraphicsTextItemDelegate::ChangeTextSize(qreal factor, textChangeMode cha
nextCharBrush = cursor.charFormat().foreground();
iNextPointSize = nextCharFont.pointSize();
if ((iPointSize != iNextPointSize)||(iCursorPos+iBlockLen >= endPos)||(0 != curFont.family().compare(nextCharFont.family()))||(curBrush != nextCharBrush)){
if (
(iPointSize != iNextPointSize)
|| (iCursorPos+iBlockLen >= endPos)
|| (curFont.family().compare(nextCharFont.family()) != 0)
|| (curFont.italic() != nextCharFont.italic())
|| (curFont.bold() != nextCharFont.bold())
|| (curFont.underline() != nextCharFont.underline())
|| (curBrush != nextCharBrush))
{
bEndofTheSameBlock = true;
break;
}
......@@ -647,7 +655,7 @@ void UBGraphicsTextItemDelegate::ChangeTextSize(qreal factor, textChangeMode cha
textFormat.setFont(tmpFont);
textFormat.setForeground(curBrush);
cursor.setPosition (iCursorPos+iBlockLen, QTextCursor::KeepAnchor);
cursor.setCharFormat(textFormat);
cursor.mergeCharFormat(textFormat);
iCursorPos += iBlockLen;
cursor.setPosition (iCursorPos, QTextCursor::MoveAnchor);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment