Skip to content

Commit

Permalink
[ren.text_renderer] fixed a bug where get_char_occupancy would not in…
Browse files Browse the repository at this point in the history
…clude chars for all added strings
  • Loading branch information
harrand committed Mar 4, 2024
1 parent d8c5d66 commit 3f033ec
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/tz/ren/text.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -253,9 +253,9 @@ namespace tz::ren
std::size_t char_storage::get_char_occupancy(tz::gl::renderer_handle rh) const
{
std::size_t total_char_count = 0;
std::vector<string_locator> locators(this->string_cursor);
std::vector<string_locator> locators(this->get_string_capacity(rh));
auto resource_data = tz::gl::get_device().get_renderer(rh).get_resource(this->string_buffer)->data_as<const string_locator>();
std::copy(resource_data.begin(), resource_data.begin() + this->string_cursor, locators.begin());
std::copy(resource_data.begin(), resource_data.end(), locators.begin());
for(const auto& loc : locators)
{
total_char_count += loc.count;
Expand Down

0 comments on commit 3f033ec

Please sign in to comment.