Refine height calculation of template parameter docs

Instead of using a potentially weird fractional value like 3.2 lets
use the floor(ed) value, e.g. 3. Reasoning: These fractions are not
from text lines but optional margins between some of the lines. These
margins should not be counted.

Also increase the cut point from >=3 to >3. This is much closer to
the original specification that talked about "2 lines plus x
characters". See T273426. These "x characters" are the 3rd line.

Bug: T310775
Change-Id: Ib5d1642d7967593dd5f13e556c6244fc44677af4
This commit is contained in:
Thiemo Kreuz 2022-06-16 15:55:19 +02:00 committed by WMDE-Fisch
parent 08e8581944
commit 217885013a

View file

@ -132,7 +132,7 @@ ve.ui.MWExpandableContentElement.prototype.onDescriptionClick = function () {
ve.ui.MWExpandableContentElement.prototype.updateSize = function () {
this.toggle( true );
if ( this.getTextHeight() / this.getLineHeight() >= 3 ) {
if ( Math.floor( this.getTextHeight() / this.getLineHeight() ) > 3 ) {
if ( !this.$container ) {
this.makeCollapsible();
}