Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    FormItem -> bug in "getPageRectIncludingTitle" method

    Hi Isomorphic,

    I checked your latest build (SNAPSHOT_v13.0d_2021-01-21) and you seem to have a bug in getPageRectIncludingTitle function in FormItem.js

    When the titleOrientation="top", the value of top should be reduced by titleHeight value

    *moreover, this.titleOrientation == "left" appears twice in the condition

    Currently, the returned rectangle is lower than expected.



    Code:
    getPageRectIncludingTitle : function () {
            var left = this.getPageLeft(),
                top = this.getPageTop(),
                width = this.getVisibleWidth(),
                height = this.getVisibleHeight();
    
            if (this.showTitle) {
                var titleLeft = this.getTitlePageLeft(),
                    titleTop = this.getTitlePageTop(),
                    titleWidth = this.getVisibleTitleWidth(),
                    titleHeight = this.form.getTitleHeight(this);
                if (this.titleOrientation == "left" || this.titleOrientation == "left" ||
                    this.titleOrientation == null) 
                {
                    left = left < titleLeft ? left : titleLeft;
                    width += titleWidth; 
                } else {
                    left = left < titleLeft ? left : titleLeft;
                    width = width > titleWidth ? width : titleWidth;
                    if (isc.isA.Number(titleHeight)) height += titleHeight;
                }
            }
            return [left, top, width, height];        
        }

    Thanks
    Kobi

    #2
    That's not a documented API, and neither is the way that it can called from the documented API getPageRect(), so don't use it. But thanks, it was being used internally, just never with titleOrientation="top".

    Comment

    Working...
    X