BlockAnalyzer: Formatting
This commit is contained in:
@@ -66,6 +66,7 @@ BlockAnalyzer::BlockAnalyzer(QWidget *parent)
|
|||||||
|
|
||||||
// mxcl says null pixmaps cause crashes, so let's play it safe
|
// mxcl says null pixmaps cause crashes, so let's play it safe
|
||||||
std::fill(fade_bars_.begin(), fade_bars_.end(), QPixmap(1, 1));
|
std::fill(fade_bars_.begin(), fade_bars_.end(), QPixmap(1, 1));
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void BlockAnalyzer::resizeEvent(QResizeEvent *e) {
|
void BlockAnalyzer::resizeEvent(QResizeEvent *e) {
|
||||||
@@ -107,6 +108,7 @@ void BlockAnalyzer::resizeEvent(QResizeEvent *e) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
drawBackground();
|
drawBackground();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void BlockAnalyzer::determineStep() {
|
void BlockAnalyzer::determineStep() {
|
||||||
@@ -118,6 +120,7 @@ void BlockAnalyzer::determineStep() {
|
|||||||
const double fallTime = static_cast<double>(timeout() < 20 ? 20 * rows_ : 30 * rows_);
|
const double fallTime = static_cast<double>(timeout() < 20 ? 20 * rows_ : 30 * rows_);
|
||||||
|
|
||||||
step_ = static_cast<double>(rows_ * timeout()) / fallTime;
|
step_ = static_cast<double>(rows_ * timeout()) / fallTime;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void BlockAnalyzer::framerateChanged() {
|
void BlockAnalyzer::framerateChanged() {
|
||||||
@@ -133,6 +136,7 @@ void BlockAnalyzer::transform(Scope &s) {
|
|||||||
|
|
||||||
// the second half is pretty dull, so only show it if the user has a large analyzer by setting to scope_.size() if large we prevent interpolation of large analyzers, this is good!
|
// the second half is pretty dull, so only show it if the user has a large analyzer by setting to scope_.size() if large we prevent interpolation of large analyzers, this is good!
|
||||||
s.resize(scope_.size() <= kMaxColumns / 2 ? kMaxColumns / 2 : scope_.size());
|
s.resize(scope_.size() <= kMaxColumns / 2 ? kMaxColumns / 2 : scope_.size());
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void BlockAnalyzer::analyze(QPainter &p, const Scope &s, const bool new_frame) {
|
void BlockAnalyzer::analyze(QPainter &p, const Scope &s, const bool new_frame) {
|
||||||
@@ -200,6 +204,7 @@ void BlockAnalyzer::analyze(QPainter &p, const Scope &s, const bool new_frame) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
p.drawPixmap(0, 0, canvas_);
|
p.drawPixmap(0, 0, canvas_);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline void adjustToLimits(const int b, int &f, int &amount) {
|
static inline void adjustToLimits(const int b, int &f, int &amount) {
|
||||||
@@ -226,6 +231,7 @@ static inline void adjustToLimits(const int b, int &f, int &amount) {
|
|||||||
f = 255;
|
f = 255;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -332,6 +338,7 @@ QColor ensureContrast(const QColor &bg, const QColor &fg, int amount) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
return Qt::blue;
|
return Qt::blue;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void BlockAnalyzer::paletteChange(const QPalette &_palette) {
|
void BlockAnalyzer::paletteChange(const QPalette &_palette) {
|
||||||
@@ -382,6 +389,7 @@ void BlockAnalyzer::paletteChange(const QPalette &_palette) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
drawBackground();
|
drawBackground();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void BlockAnalyzer::drawBackground() {
|
void BlockAnalyzer::drawBackground() {
|
||||||
@@ -404,4 +412,5 @@ void BlockAnalyzer::drawBackground() {
|
|||||||
p.fillRect(x * (kWidth + 1), y * (kHeight + 1) + y_, kWidth, kHeight, bgdark);
|
p.fillRect(x * (kWidth + 1), y * (kHeight + 1) + y_, kWidth, kHeight, bgdark);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user