Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 3 additions & 12 deletions frontend/static/yw/javascript/renderer.js
Original file line number Diff line number Diff line change
Expand Up @@ -766,21 +766,12 @@ function drawBlockChar(charCode, textRender, x, y, cellW, cellH, altGrid) {
}
}

function dispatchCharClientHook(cCode, textRender, tileX, tileY, x, y, clampW, clampH) {
function dispatchCharClientHook(cCode, textRender, tileX, tileY, charX, charY, offsetX, offsetY, cellW, cellH) {
var funcs = specialClientHooks.renderchar;
if(!funcs.length) return false;
for(var i = 0; i < funcs.length; i++) {
var func = funcs[i];
// duplicate from drawBlockChar - needs refactoring
var tmpCellW = clampW / tileC;
var tmpCellH = clampH / tileR;
var sx = Math.floor(x * tmpCellW);
var sy = Math.floor(y * tmpCellH);
var ex = Math.floor((x + 1) * tmpCellW);
var ey = Math.floor((y + 1) * tmpCellH);
tmpCellW = ex - sx;
tmpCellH = ey - sy;
var status = func(cCode, textRender, tileX, tileY, x, y, sx, sy, tmpCellW, tmpCellH);
var status = func(cCode, textRender, tileX, tileY, charX, charY, offsetX, offsetY, cellW, cellH);
if(status) {
return true;
}
Expand Down Expand Up @@ -898,7 +889,7 @@ function renderChar(textRender, offsetX, offsetY, char, color, cellW, cellH, pro
}

if(((specialClientHookMap >> 0) & 1) && !isOverflow) {
var status = dispatchCharClientHook(cCode, textRender, tileX, tileY, charX, charY, cellW, cellH);
var status = dispatchCharClientHook(cCode, textRender, tileX, tileY, charX, charY, fontX, fontY, cellW, cellH);
if(status) {
return true;
}
Expand Down