Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

show air in Block Statistic Search #364

Merged
merged 1 commit into from
Jul 28, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion search/statisticdialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -245,12 +245,15 @@ void StatisticDialog::updateResultImage()
for (auto key: resultMap.keys()) {
int y = (height-1) - key + ui->range->getRangeY().begin();
const StatisticResultItem &result = resultMap.value(key);
float scaleR = float(result.count) / float(max_count);
float scaleR = float(result.count) / float(max_count); // searched Blocks
float scaleA = float(result.total - result.air) / float(max_count); // non Air Blocks
float scaleW = 1.0 / float(width);
for (int x = 0; x < width; x++) {
QColor color;
if (x*scaleW < scaleR) {
color = QColor(64,192,64);
} else if (x*scaleW > scaleA) {
color = QColor(108,156,240);
} else {
color = QColor(128,128,128);
}
Expand Down