Skip to content

BUG FIX: fix two GUI bugs in convoy detail window#581

Open
kanyao1230 wants to merge 2 commits into
teamhimeh:OTRP-KUTAv6from
kanyao1230:feature/fix-convoi-transfer-scroll
Open

BUG FIX: fix two GUI bugs in convoy detail window#581
kanyao1230 wants to merge 2 commits into
teamhimeh:OTRP-KUTAv6from
kanyao1230:feature/fix-convoi-transfer-scroll

Conversation

@kanyao1230

Copy link
Copy Markdown

概要

車両詳細ウィンドウの不具合を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() よりに移動し、描画前にレイアウトを最新のウィンドウサイズで更新するよう変更。

kanyao1230 and others added 2 commits June 11, 2026 01:57
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>

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));

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ほかのcomboboxでも問題なく動作することを一応確認・コメントしてください

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants