fix(layout): the clock format and the per-tab timestamp switch move row heights
Two more axes the height cache never knew about, and the second one is not even wired up yet -- it is about to be. Use24HourClock changes the stamp from 15:45 to 3:45 PM. The stamp sits at the head of the line with SameLine(0,0), so the wrap width every following word is measured against shrinks. Rows that wrap near that boundary get a different height, and nothing dropped the cache. DisplayTimestamp is per tab, which is why BuildLayoutFingerprint now takes the tab. It only ever read Plugin.Config before -- the per-tab part of this system is the gate, one per tab, comparing fingerprints that knew nothing about tabs. The switch is dead today and gets its reader in the next commit; the axis goes in first so the cache is right the moment it starts doing something. Both are toggles, so they sit in the discrete half and skip the settle window.
This commit is contained in:
@@ -99,7 +99,7 @@ internal sealed class MessageList
|
||||
// swaps between two differently sized faces), FontsEnabled and UseHellionFont
|
||||
// (both swap the face outright, and their two size fields default to the same
|
||||
// 12.75f -- so the fingerprint did not move while the glyph widths did).
|
||||
private LayoutFingerprint BuildLayoutFingerprint(float contentWidth)
|
||||
private LayoutFingerprint BuildLayoutFingerprint(Tab tab, float contentWidth)
|
||||
{
|
||||
var fonts = _fonts.EffectiveFontFingerprint();
|
||||
return new LayoutFingerprint(
|
||||
@@ -112,6 +112,8 @@ internal sealed class MessageList
|
||||
Plugin.Config.FontsEnabled,
|
||||
Plugin.Config.UseHellionFont,
|
||||
Plugin.Config.ItalicEnabled,
|
||||
Plugin.Config.Use24HourClock,
|
||||
tab.DisplayTimestamp,
|
||||
(int)Plugin.Config.NameFormMode,
|
||||
(int)Plugin.Config.WorldSuffixMode,
|
||||
contentWidth,
|
||||
@@ -131,7 +133,7 @@ internal sealed class MessageList
|
||||
_fingerprintGates[tab.Identifier] = gate;
|
||||
}
|
||||
|
||||
if (!gate.ShouldInvalidate(BuildLayoutFingerprint(contentWidth), nowMs))
|
||||
if (!gate.ShouldInvalidate(BuildLayoutFingerprint(tab, contentWidth), nowMs))
|
||||
return;
|
||||
|
||||
using var messages = tab.Messages.GetReadOnly(3);
|
||||
|
||||
@@ -12,6 +12,8 @@ internal readonly record struct LayoutFingerprint(
|
||||
bool FontsEnabled,
|
||||
bool UseHellionFont,
|
||||
bool ItalicEnabled,
|
||||
bool Use24Hour,
|
||||
bool ShowTimestamp,
|
||||
int NameForm,
|
||||
int WorldSuffix,
|
||||
float Width,
|
||||
@@ -21,8 +23,17 @@ internal readonly record struct LayoutFingerprint(
|
||||
// Toggles: they land on a new value in one frame and stay there. Waiting on
|
||||
// them would leave the planner running against the previous density's
|
||||
// heights while the rows are already painted the new way.
|
||||
internal (bool, bool, bool, bool, int, int) Discrete =>
|
||||
(Compact, FontsEnabled, UseHellionFont, ItalicEnabled, NameForm, WorldSuffix);
|
||||
internal (bool, bool, bool, bool, bool, bool, int, int) Discrete =>
|
||||
(
|
||||
Compact,
|
||||
FontsEnabled,
|
||||
UseHellionFont,
|
||||
ItalicEnabled,
|
||||
Use24Hour,
|
||||
ShowTimestamp,
|
||||
NameForm,
|
||||
WorldSuffix
|
||||
);
|
||||
}
|
||||
|
||||
// Dragging a window edge or the Dalamud UI-scale slider moves the continuous
|
||||
|
||||
Reference in New Issue
Block a user