Skip to content

Commit 4ed4246

Browse files
committed
fix(chat): auto-size raid-target markers to the chat font
{rtN}/{skull}/etc. emitted a hardcoded :14:14 size, so a marker never tracked the chat font-size setting. Emit :0:0 instead — the inline emitter resolves height/width to the target line's font pixel height at draw time, so markers grow and shrink with the chat font and scale up in speech bubbles, matching retail's ICON_LIST `...Icon_%d:0`. The sheet crop is size-independent, so cell selection is unchanged.
1 parent 31e8573 commit 4ed4246

1 file changed

Lines changed: 7 additions & 7 deletions

File tree

‎src/chat/RaidMarkers.cpp‎

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -40,11 +40,6 @@ namespace Chat::RaidMarkers {
4040

4141
namespace {
4242

43-
// On-screen pixel size of an inline marker. The default chat font is ~14px, so 14
44-
// keeps a marker about one line tall. Fixed (the substitution is a static string
45-
// rewrite and can't see the target font); tunable here if it reads too small/large.
46-
constexpr int kMarkerSizePx = 14;
47-
4843
struct Token {
4944
const char *name; // lowercase alias, no braces
5045
int marker; // raid-target index 1..8
@@ -126,11 +121,16 @@ const char *Substitute(const char *msg, char *buf, size_t bufSize) {
126121
// and renders). Anti-spoof Sanitize runs before this, so these
127122
// are the only `||T` openers a player can produce.
128123
char markup[128];
124+
// `:0:0` = auto-size. The inline emitter resolves height/width
125+
// to the target line's font pixel height at draw time, so a
126+
// marker tracks the chat font size (and grows in speech bubbles)
127+
// exactly like retail's ICON_LIST `…Icon_%d:0`. The rest of the
128+
// payload crops the 256x256 sheet to the cell (l,r,t,b).
129129
const int m = std::snprintf(
130130
markup, sizeof markup,
131-
"||TInterface\\TargetingFrame\\UI-RaidTargetingIcons:%d:%d:0:0:256:256:"
131+
"||TInterface\\TargetingFrame\\UI-RaidTargetingIcons:0:0:0:0:256:256:"
132132
"%d:%d:%d:%d||t",
133-
kMarkerSizePx, kMarkerSizePx, l, r, t, b);
133+
l, r, t, b);
134134
// Reserve room for the literal tail after this token
135135
// (msg[k+1..]) so the rest of the message always fits.
136136
const size_t tail = msgLen - (k + 1);

0 commit comments

Comments
 (0)