Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[orion-dev] Why is ruler offset by lineHeight ?

I'm trying to implement a custom annotation. My marker ends up too high. I tracked this down to the containing div having an offset of -lineHeight:

function _updateRulerSize(divRuler) {
 if (!divRuler) { return; }
 var rulerHeight = clientHeight + + viewPad.bottom;
 var cells = divRuler.firstChild.rows[0].cells;
 for (var i = 0; i < cells.length; i++) {
   var div = cells[i].firstChild;
   var offset = lineHeight;
   if (div._ruler.getOverview() === "page") { offset += partialY; } = -offset + "px";
-------------------^^^^^^^^^^^^^^^^ = (rulerHeight + offset) + "px";
   div = div.nextSibling;
 } = rulerHeight + "px";

Does anyone know why this offset is applied? It overwrites my setting.

I guess the workaround is to offset all of the markers. That means I would need to know the lineHeight, but it seems to be private, _getLineHeight(). Any hints?


Back to the top