BUG FIX: fix two GUI bugs in convoy detail window#581
Open
kanyao1230 wants to merge 2 commits into
Open
Conversation
Only call request_size() when the droplist width actually changes, avoiding the set_size() -> show_focused() chain that reset scroll position. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
set_windowsize was called after gui_frame_t::draw, causing the layout to be recomputed only after rendering. During resize this meant each frame was drawn with the previous frame's layout. Moving set_windowsize before draw ensures the layout matches the current window size. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
simupoppo
approved these changes
Jun 11, 2026
|
|
||
| droplist.request_size(scr_size(this->size.w, droplist.get_size().h)); | ||
| if( droplist.get_size().w != this->size.w ) { | ||
| droplist.request_size(scr_size(this->size.w, droplist.get_size().h)); |
Collaborator
There was a problem hiding this comment.
ほかのcomboboxでも問題なく動作することを一応確認・コメントしてください
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
概要
車両詳細ウィンドウの不具合を2点修正します。
修正内容
1. 会社選択コンボボックスのスクロール位置がリセットされる問題
車両を譲渡する際、会社を選択するコンボボックスのドロップリストを開いてスクロールしようとすると、毎フレームスクロール位置が先頭に戻ってしまい、正しく選択できない問題を修正しました。
原因:
gui_combobox_t::set_size()内で、ドロップリストの幅が変わっていないにもかかわらず毎フレームdroplist.request_size()を呼んでいた。request_size()は内部でshow_focused()を呼び出しており、これがスクロール位置を選択中アイテムへ強制的に戻していた。修正: ドロップリストの幅が実際に変化した場合のみ
request_size()を呼ぶよう変更。2. ウィンドウのリサイズ中に上部セクションの幅がちらつく問題
ウィンドウ右下のリサイズハンドルをドラッグすると、タブより上のセクション(速度バーなど)の幅が正しく追従せずにちらつく問題を修正しました。
原因:
convoi_info_t::draw()の末尾でgui_frame_t::draw()の後にset_windowsize()を呼んでいた。そのため、レイアウトの再計算が常に1フレーム遅れており、描画は常に「前フレームのウィンドウサイズ」に基づいたレイアウトで行われていた。修正:
set_windowsize()をgui_frame_t::draw()より前に移動し、描画前にレイアウトを最新のウィンドウサイズで更新するよう変更。