mirror of
https://github.com/WerWolv/ImHex.git
synced 2026-03-30 13:05:25 -05:00
patterns: Fixed various render issues
This commit is contained in:
@@ -77,7 +77,7 @@ namespace hex::pl {
|
||||
[[nodiscard]] const std::optional<std::string> &getComment() const { return this->m_comment; }
|
||||
void setComment(std::string comment) { this->m_comment = std::move(comment); }
|
||||
|
||||
[[nodiscard]] const std::string &getTypeName() const { return this->m_typeName; }
|
||||
[[nodiscard]] virtual std::string getTypeName() const { return this->m_typeName; }
|
||||
void setTypeName(std::string name) { this->m_typeName = std::move(name); }
|
||||
|
||||
[[nodiscard]] u32 getColor() const { return this->m_color; }
|
||||
|
||||
@@ -39,7 +39,7 @@ namespace hex::pl {
|
||||
return this->m_entries[0]->getTypeName() + "[" + std::to_string(this->m_entries.size()) + "]";
|
||||
}
|
||||
|
||||
[[nodiscard]] std::string getTypeName() const {
|
||||
[[nodiscard]] std::string getTypeName() const override {
|
||||
return this->m_entries[0]->getTypeName();
|
||||
}
|
||||
|
||||
@@ -58,7 +58,7 @@ namespace hex::pl {
|
||||
return this->m_entries;
|
||||
}
|
||||
|
||||
void forEachArrayEntry(const std::function<void(int, Pattern&)>& fn) {
|
||||
void forEachArrayEntry(const std::function<void(u64, Pattern&)>& fn) {
|
||||
for (u64 i = 0; i < this->m_entries.size(); i++)
|
||||
fn(i, *this->m_entries[i]);
|
||||
}
|
||||
|
||||
@@ -19,9 +19,10 @@ namespace hex::pl {
|
||||
return std::unique_ptr<Pattern>(new PatternArrayStatic(*this));
|
||||
}
|
||||
|
||||
void forEachArrayEntry(const std::function<void(int, Pattern&)>& fn) {
|
||||
void forEachArrayEntry(const std::function<void(u64, Pattern&)>& fn) {
|
||||
auto entry = std::shared_ptr(this->m_template->clone());
|
||||
for (u64 index = 0; index < this->m_entryCount; index++) {
|
||||
entry->clearFormatCache();
|
||||
entry->setVariableName(hex::format("[{0}]", index));
|
||||
entry->setOffset(this->getOffset() + index * this->m_template->getSize());
|
||||
fn(index, *entry);
|
||||
|
||||
@@ -24,7 +24,7 @@ namespace hex::pl {
|
||||
return "enum " + Pattern::getTypeName();
|
||||
}
|
||||
|
||||
[[nodiscard]] std::string getTypeName() const {
|
||||
[[nodiscard]] std::string getTypeName() const override {
|
||||
return Pattern::getTypeName();
|
||||
}
|
||||
|
||||
|
||||
@@ -67,10 +67,6 @@ namespace hex::pl {
|
||||
return "union " + Pattern::getTypeName();
|
||||
}
|
||||
|
||||
[[nodiscard]] std::string getTypeName() const {
|
||||
return Pattern::getTypeName();
|
||||
}
|
||||
|
||||
[[nodiscard]] const auto &getMembers() const {
|
||||
return this->m_members;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user