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.top + 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; }
   div.style.top = -offset + "px";
-------------------^^^^^^^^^^^^^^^^
   div.style.height = (rulerHeight + offset) + "px";
   div = div.nextSibling;
 }
 divRuler.style.height = rulerHeight + "px";
}
_updateRulerSize(this._leftDiv);


Does anyone know why this offset is applied? It overwrites my style.top 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?

jjb

Back to the top