~ruther/CTU-FEE-B0B35APO-Semestral-project

247d0c106cc3c32caef42a555948bb0b8cd32ff6 — František Boháček 3 years ago 1a492df
fix: floating point exception
1 files changed, 3 insertions(+), 0 deletions(-)

M text-viewer/src/text_viewer.c
M text-viewer/src/text_viewer.c => text-viewer/src/text_viewer.c +3 -0
@@ 209,6 209,9 @@ static void command_handler_zoom_in(void *state, int amount) {

  amount = amount > 1 ? 1 : -1;
  text->font->size += amount;
  if (text->font->size == 0) {
    text->font->size = 1;
  }

  component->y += amount * (component->y / (old_size + text->font->line_spacing));
}

Do not follow this link