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);
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);
break;
case Qt::AlignRight :
} else if (cf & Qt::AlignRight) {
asAlBtn->setKind(AlignTextButton::k_right);
break;
default:
} else {
asAlBtn->setKind(AlignTextButton::k_left);
break;
}
}

Loading…
Cancel
Save