Commit f2ee1360 authored by Aleksei Kanash's avatar Aleksei Kanash

Addition to SANKORE-408.

parent d0532533
...@@ -305,7 +305,7 @@ void UBGraphicsTextItemDelegate::ChangeTextSize(int delta) ...@@ -305,7 +305,7 @@ void UBGraphicsTextItemDelegate::ChangeTextSize(int delta)
bool bEndofTheSameBlock; bool bEndofTheSameBlock;
int iBlockLen; int iBlockLen;
int iPointSize; int iPointSize;
int inewPointSize; int iNextPointSize;
int iCursorPos = startPos; int iCursorPos = startPos;
// we search continuous blocks of the text with the same PointSize and allpy new settings for them. // we search continuous blocks of the text with the same PointSize and allpy new settings for them.
...@@ -327,17 +327,18 @@ void UBGraphicsTextItemDelegate::ChangeTextSize(int delta) ...@@ -327,17 +327,18 @@ void UBGraphicsTextItemDelegate::ChangeTextSize(int delta)
iBlockLen++; iBlockLen++;
cursor.setPosition (iCursorPos+iBlockLen+1, QTextCursor::KeepAnchor); cursor.setPosition (iCursorPos+iBlockLen+1, QTextCursor::KeepAnchor);
inewPointSize = cursor.charFormat().font().pointSize(); iNextPointSize = cursor.charFormat().font().pointSize();
cursor.setPosition (iCursorPos+iBlockLen, QTextCursor::KeepAnchor); cursor.setPosition (iCursorPos+iBlockLen, QTextCursor::KeepAnchor);
if ((iPointSize != inewPointSize)||(iCursorPos+iBlockLen >= endPos)) if ((iPointSize != iNextPointSize)||(iCursorPos+iBlockLen >= endPos))
bEndofTheSameBlock = true; bEndofTheSameBlock = true;
}while(!bEndofTheSameBlock); }while(!bEndofTheSameBlock);
//setting new parameners //setting new parameners
curFont.setPointSize(iPointSize + delta); int iNewPointSize = iPointSize + delta;
curFont.setPointSize( (iNewPointSize > 0)?iNewPointSize:1);
textFormat.setFont(curFont); textFormat.setFont(curFont);
cursor.mergeCharFormat(textFormat); cursor.mergeCharFormat(textFormat);
......
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