Fix with checking flags UBGraphicsTextItem using bit and instead of case condition

preferencesAboutTextFull
Ilia Ryabokon 11 years ago
parent 9820a763c0
commit e111b59d76
  1. 14
      src/domain/UBGraphicsTextItemDelegate.cpp

@ -652,16 +652,16 @@ void UBGraphicsTextItemDelegate::updateAlighButtonState()
} }
asAlBtn->setMixedButtonVisible(false); asAlBtn->setMixedButtonVisible(false);
switch (static_cast<int>(delegated()->textCursor().blockFormat().alignment())) {
case Qt::AlignCenter : Qt::Alignment cf = delegated()->textCursor().blockFormat().alignment();
qDebug() << "getting alignment" << cf;
if (cf & Qt::AlignCenter) {
asAlBtn->setKind(AlignTextButton::k_center); asAlBtn->setKind(AlignTextButton::k_center);
break; } else if (cf & Qt::AlignRight) {
case Qt::AlignRight :
asAlBtn->setKind(AlignTextButton::k_right); asAlBtn->setKind(AlignTextButton::k_right);
break; } else {
default:
asAlBtn->setKind(AlignTextButton::k_left); asAlBtn->setKind(AlignTextButton::k_left);
break;
} }
} }

Loading…
Cancel
Save