Commit e111b59d authored by Ilia Ryabokon's avatar Ilia Ryabokon

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

parent 9820a763
......@@ -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;
}
}
......
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