nelsam / vidar

vidar is a highly experimental Go editor, written in Go, using gxui
The Unlicense
50 stars 7 forks source link

Horizontal scrollbar doesn't contain thumb after resize. #177

Closed Kvaz1r closed 4 years ago

Kvaz1r commented 5 years ago

Description

Horizontal scrollbar doesn't contain thumb after resize.

Steps to reproduce

  1. Open file
  2. Resize editor so that horizontal scrollbar must appear

Expected behavior

Horizontal scrollbar contains thumb.

Actual behavior

Horizontal scrollbar doesn't contain thumb.

Kvaz1r commented 5 years ago

It's regression from this commit. There is also dependency from size (here and here) so ScrollPosition need been updated after resize too.

nelsam commented 5 years ago

Yep, I see it. Thanks! It looks like we need to do a little more checking in that code.

Kvaz1r commented 5 years ago

I don't see good fix for it. Or cache for size or ugly reset and restore horizOffset in SetSize:

    temp := e.horizOffset
    e.horizOffset = -1
    e.SetHorizOffset(temp)
Kvaz1r commented 4 years ago

Fixed by https://github.com/nelsam/gxui/pull/24