framework-widget icon indicating copy to clipboard operation
framework-widget copied to clipboard

Warning adding a line into a scroll view

Open melix99 opened this issue 7 years ago • 1 comments

When I add a display.newLine in a widget.scrollView I get a warning that says: "line.width is deprecated. Use line.strokeWidth".

melix99 avatar Aug 10 '18 16:08 melix99

Example code:

local widget = require("widget")
local testScrollView =
    widget.newScrollView(
    {
        left = 0,
        top = 11,
        width = 100,
        height = 200
    }
)

local line = display.newLine(11, 11, 111, 111)
testScrollView:insert(line)

Warning occures in widgetLibrary/widget_scrollview.lua line 371

local leftPadding = self._collectorGroup[ 1 ].x - ( self._collectorGroup[ 1 ].width * 0.5 )

I think it should use contentWidth instead, because padding is calculated wrong for scaled display objects

Benzeliden avatar Sep 15 '18 10:09 Benzeliden