mirror of
https://github.com/rizinorg/cutter.git
synced 2024-12-20 11:56:12 +00:00
Fix VisualNavbar range
This commit is contained in:
parent
f12118f4d4
commit
8566e9e2b3
@ -1546,8 +1546,6 @@ BlockStatistics CutterCore::getBlockStatistics(unsigned int blocksCount)
|
|||||||
|
|
||||||
QJsonArray blocksArray = statsObj["blocks"].toArray();
|
QJsonArray blocksArray = statsObj["blocks"].toArray();
|
||||||
|
|
||||||
printf("got %d blocks for requested %u\n", blocksArray.count(), blocksCount);
|
|
||||||
|
|
||||||
for (const QJsonValue &value : blocksArray) {
|
for (const QJsonValue &value : blocksArray) {
|
||||||
QJsonObject blockObj = value.toObject();
|
QJsonObject blockObj = value.toObject();
|
||||||
BlockDescription block;
|
BlockDescription block;
|
||||||
|
@ -106,12 +106,11 @@ void VisualNavbar::fillData()
|
|||||||
int h = graphicsView->height();
|
int h = graphicsView->height();
|
||||||
|
|
||||||
RVA totalSize = stats.to - stats.from;
|
RVA totalSize = stats.to - stats.from;
|
||||||
|
RVA beginAddr = stats.from;
|
||||||
printf("from: %llu, to %llu, first: %llu\n", stats.from, stats.to, stats.blocks[0].addr);
|
|
||||||
|
|
||||||
double widthPerByte = (double)w / (double)totalSize;
|
double widthPerByte = (double)w / (double)totalSize;
|
||||||
auto xFromAddr = [widthPerByte] (RVA addr) -> double {
|
auto xFromAddr = [widthPerByte, beginAddr] (RVA addr) -> double {
|
||||||
return addr * widthPerByte;
|
return (addr - beginAddr) * widthPerByte;
|
||||||
};
|
};
|
||||||
|
|
||||||
std::array<QBrush, static_cast<int>(DataType::Count)> dataTypeBrushes;
|
std::array<QBrush, static_cast<int>(DataType::Count)> dataTypeBrushes;
|
||||||
@ -133,12 +132,14 @@ void VisualNavbar::fillData()
|
|||||||
xToAddress.append(x2a);
|
xToAddress.append(x2a);
|
||||||
|
|
||||||
DataType dataType;
|
DataType dataType;
|
||||||
if (block.inFunctions > 0) {
|
if (block.functions > 0) {
|
||||||
dataType = DataType::Code;
|
dataType = DataType::Code;
|
||||||
} else if (block.strings > 0) {
|
} else if (block.strings > 0) {
|
||||||
dataType = DataType::String;
|
dataType = DataType::String;
|
||||||
} else if (block.symbols > 0) {
|
} else if (block.symbols > 0) {
|
||||||
dataType = DataType::Symbol;
|
dataType = DataType::Symbol;
|
||||||
|
} else if (block.inFunctions > 0) {
|
||||||
|
dataType = DataType::Code;
|
||||||
} else {
|
} else {
|
||||||
lastDataType = DataType::Empty;
|
lastDataType = DataType::Empty;
|
||||||
continue;
|
continue;
|
||||||
|
Loading…
Reference in New Issue
Block a user