mirror of
https://github.com/baldurk/renderdoc.git
synced 2026-05-04 09:00:44 +00:00
Fix some painting not reacting to different fonts correctly
This commit is contained in:
@@ -25,6 +25,7 @@
|
||||
#include "PipelineFlowChart.h"
|
||||
#include <QMouseEvent>
|
||||
#include <QPainter>
|
||||
#include "Code/QRDUtils.h"
|
||||
|
||||
PipelineFlowChart::PipelineFlowChart(QWidget *parent) : QFrame(parent)
|
||||
{
|
||||
@@ -183,6 +184,8 @@ void PipelineFlowChart::paintEvent(QPaintEvent *e)
|
||||
|
||||
QPainter p(this);
|
||||
|
||||
p.setFont(Formatter::PreferredFont());
|
||||
|
||||
p.fillRect(rect(), Qt::transparent);
|
||||
|
||||
p.setRenderHint(QPainter::Antialiasing, true);
|
||||
|
||||
@@ -239,7 +239,7 @@ void TimelineBar::layout()
|
||||
m_markerRect.setTop(m_eidAxisRect.bottom() + margin);
|
||||
|
||||
m_highlightingRect = m_area;
|
||||
m_highlightingRect.setHeight(qMax(fm.height(), dataBarHeight) + highlightingExtra);
|
||||
m_highlightingRect.setHeight(qMax(fm.height(), dataBarHeight) * 2 + highlightingMargin);
|
||||
m_highlightingRect.moveTop(m_markerRect.bottom() - m_highlightingRect.height());
|
||||
|
||||
m_markerRect.setBottom(m_highlightingRect.top());
|
||||
@@ -473,8 +473,6 @@ void TimelineBar::paintEvent(QPaintEvent *e)
|
||||
to.setWrapMode(QTextOption::NoWrap);
|
||||
to.setAlignment(Qt::AlignLeft | Qt::AlignVCenter);
|
||||
|
||||
QFontMetrics fm = p.fontMetrics();
|
||||
|
||||
{
|
||||
QRectF titleRect = m_eidAxisRect;
|
||||
titleRect.setLeft(titleRect.left() - m_titleWidth);
|
||||
@@ -508,6 +506,8 @@ void TimelineBar::paintEvent(QPaintEvent *e)
|
||||
|
||||
p.setFont(Formatter::PreferredFont());
|
||||
|
||||
QFontMetrics fm = p.fontMetrics();
|
||||
|
||||
QRectF hoverRect = eidAxisRect;
|
||||
|
||||
// clip labels to the visible section
|
||||
|
||||
@@ -85,8 +85,8 @@ private:
|
||||
const qreal margin = 2.0;
|
||||
const qreal borderWidth = 1.0;
|
||||
const QString eidAxisTitle = lit("EID:");
|
||||
const int dataBarHeight = 18;
|
||||
const int highlightingExtra = 12;
|
||||
const int dataBarHeight = 16;
|
||||
const int highlightingMargin = 2;
|
||||
|
||||
int m_eidAxisLabelStep = 0;
|
||||
qreal m_eidAxisLabelTextWidth = 0;
|
||||
|
||||
Reference in New Issue
Block a user