Repository navigation
HeaderE231 の駅名フォントを白枠に収まる固定サイズにする - #6106
Merged
Merged
Conversation
白枠は固定 dp 高さなのに駅名だけ RFValue で画面スケールしていたため、縦長端末でフォントが枠高を超えてはみ出していた。枠の内寸に連動した固定サイズに変更し、どのデバイスでも白枠内に収まるようにする。
Contributor
📝 WalkthroughWalkthroughHeaderE231 の駅名エリア高さ・枠幅・駅名フォントサイズを駅名エリア高さに連動する定数で算出・適用し、HeaderStationName のテキスト幅フォールバックを renderTextWidth || containerWidth || '100%' に変更しました。 Changes駅名表示スタイル統一と幅フォールバック改善
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
Suggested labels
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
HeaderStationName は計測(コンテナ幅・文字幅)が揃うまで widthScale が 1 のままで、縮小前の等倍テキストが 1 フレーム見えていた。計測完了まで表示用テキストを opacity 0 で隠し、scaleX 確定後に表示する。
計測完了まで opacity 0 で隠す方式は、デバッグビルドなど計測コールバックが遅延する環境で一瞬何も表示されない空白として見えていた。隠す代わりに計測前の内側ビュー幅をコンテナ幅(未確定なら 100%)にクランプし、等倍でもはみ出さず空白にもならないようにする。
計測前の表示を opacity 0 で隠す/枠内クランプする変更は、計測中は自然サイズで表示する(MEASURE_TEXT_WIDTH + scaleX 1)という既存の意図的な設計とそのテストに衝突していた。元の挙動に戻し、テストを緑に戻す。駅名表示のちらつき対策はテストの意図を踏まえて別途検討する。
4 of 9 tasks
4 of 9 tasks
Merged
4 of 9 tasks
4 tasks done
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.
概要
HeaderE231 の駅名表示が白枠からはみ出していた問題を修正します。白枠は固定 dp 高さなのに駅名フォントだけ
RFValueで画面高に応じてスケールしていたため、縦長端末ほどフォントが枠の高さを超えてはみ出していました。枠の内寸に連動した固定サイズに変更し、どのデバイスでも白枠内に収まるようにします。変更の種類
変更内容
STATION_AREA_HEIGHT/STATION_AREA_BORDER_WIDTH)し、stationAreaスタイルから参照するように統一RFValue(64)から、枠の内寸(高さ - 上下ボーダー)× 0.7 の固定サイズSTATION_NAME_FONT_SIZEに変更(80 - 4) × 0.7 = 53(128 - 8) × 0.7 = 84HeaderStationNameは横方向のみscaleXで縮小し縦方向は縮まないため、フォントサイズ自体を枠高に連動させて縦のはみ出しを防止テスト
npm run lintが通ることnpm testが通ることnpm run typecheckが通ること関連Issue
スクリーンショット(任意)