Addition to SANKORE-408.

preferencesAboutTextFull
Aleksei Kanash 13 years ago
parent d05325330c
commit f2ee136035
  1. 9
      src/domain/UBGraphicsTextItemDelegate.cpp

@ -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)
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);

Loading…
Cancel
Save