修复状态机的部分异常、计数器编辑与预览更新、修复时间、轮班图元的高度多一行的问题
This commit is contained in:
+14
-12
@@ -191,7 +191,7 @@ QImage PicDateItem::itemImage()
|
||||
return currImg;
|
||||
|
||||
int width = qMax(currImg.width(), m_maxSize.width());
|
||||
int height = qMax(currImg.height(), m_maxSize.height());
|
||||
int height = currImg.height();
|
||||
|
||||
QImage img(width, height, QImage::Format_ARGB32);
|
||||
img.fill(QColor(0,0,0,0).rgba());
|
||||
@@ -206,17 +206,19 @@ QImage PicDateItem::itemImage()
|
||||
|
||||
QRectF PicDateItem::boundingRect() const
|
||||
{
|
||||
// 优先使用已经应用变换后的 m_itemImage(与 PicTextItem 保持一致)
|
||||
if (!m_itemImage.isNull()) {
|
||||
return QRectF(0, 0, m_itemImage.width(), m_itemImage.height());
|
||||
}
|
||||
return PicTextItem::boundingRect();
|
||||
|
||||
// 否则基于缓存的最大像素尺寸和粗体倍数估算
|
||||
int w = m_maxSize.width();
|
||||
int h = m_maxSize.height();
|
||||
if (w <= 0 || h <= 0)
|
||||
return QGraphicsTextItem::boundingRect();
|
||||
// // 优先使用已经应用变换后的 m_itemImage(与 PicTextItem 保持一致)
|
||||
// if (!m_itemImage.isNull()) {
|
||||
// return QRectF(0, 0, m_itemImage.width(), m_itemImage.height());
|
||||
// }
|
||||
|
||||
qreal bw = qreal(w) * qMax(1, m_boldMultiple);
|
||||
return QRectF(0, 0, bw, qreal(h));
|
||||
// // 否则基于缓存的最大像素尺寸和粗体倍数估算
|
||||
// int w = m_maxSize.width();
|
||||
// int h = m_maxSize.height();
|
||||
// if (w <= 0 || h <= 0)
|
||||
// return QGraphicsTextItem::boundingRect();
|
||||
|
||||
// qreal bw = qreal(w) * qMax(1, m_boldMultiple);
|
||||
// return QRectF(0, 0, bw, qreal(h));
|
||||
}
|
||||
Reference in New Issue
Block a user