assert(scale > 0);
assert(_data);
- const float high_offset = rect.top() + Margin;
- const float low_offset = rect.bottom() - Margin;
+ const float high_offset = rect.top() + Margin + 0.5f;
+ const float low_offset = rect.bottom() - Margin + 0.5f;
const deque< shared_ptr<LogicDataSnapshot> > &snapshots =
_data->get_snapshots();
for(vector<LogicDataSnapshot::EdgePair>::const_iterator i =
edges.begin() + 1;
i != edges.end() - 1; i++) {
- const int x = (int)((*i).first / samples_per_pixel -
+ const float x = ((*i).first / samples_per_pixel -
pixels_offset) + rect.left();
*line++ = QLineF(x, high_offset, x, low_offset);
}
void LogicSignal::paint_caps(QPainter &p, QLineF *const lines,
vector< pair<int64_t, bool> > &edges, bool level,
- double samples_per_pixel, double pixels_offset, int x_offset,
- int y_offset)
+ double samples_per_pixel, double pixels_offset, float x_offset,
+ float y_offset)
{
QLineF *line = lines;
i != (edges.end() - 1); i++)
if((*i).second == level) {
*line++ = QLineF(
- (int)((*i).first / samples_per_pixel -
+ ((*i).first / samples_per_pixel -
pixels_offset) + x_offset, y_offset,
- (int)((*(i+1)).first / samples_per_pixel -
+ ((*(i+1)).first / samples_per_pixel -
pixels_offset) + x_offset, y_offset);
}
void paint_caps(QPainter &p, QLineF *const lines,
std::vector< std::pair<int64_t, bool> > &edges,
bool level, double samples_per_pixel, double pixels_offset,
- int x_offset, int y_offset);
+ float x_offset, float y_offset);
/**
* Get the colour of the logic signal
void Ruler::paintEvent(QPaintEvent *event)
{
QPainter p(this);
+ p.setRenderHint(QPainter::Antialiasing);
const double MinSpacing = 80;
ts << (t * multiplier) << SIPrefixes[prefix] << "s";
p.drawText(x, 0, 0, text_height, Qt::AlignCenter |
Qt::AlignTop | Qt::TextDontClip, s);
- p.drawLine(x, text_height, x, height());
+ p.drawLine(QPointF(x, text_height),
+ QPointF(x, height()));
}
else
{
// Draw a minor tick
- p.drawLine(x, (text_height + height()) / 2,
- x, height());
+ p.drawLine(QPointF(x, (text_height + height()) / 2),
+ QPointF(x, height()));
}
division++;