Widgets on Git hub _oldAnchorX

I wanted to look at the widget code, I took a copy of the widgetLibrary directory from here https://github.com/coronalabs/framework-widget and placed it into the top level directory.

I then tried to call the code like this;

 local widget = require("widgetLibrary.widget") canvas = widget.newScrollView( scrollViewOpt )

This is the error;

 

?:0: attempt to perform arithmetic on field ‘_oldAnchorX’ (a nil value)

stack traceback:

?: in function ‘_calculatePosition’

?: in function <?:749>

(tail call): ?

/Users/p/Documents/x1/CODE/F1/widgetLibrary/widget.lua:134: in function </Users/p/Documents/x1/CODE/F1/widgetLibrary/widget.lua:121>

Any ideas?

I replaced every require for X lua file in that directory with widgetLibrary.X 

eg. require( “widget” ) with require ( “widgetLibrary.widget” ) 

works now.

I replaced every require for X lua file in that directory with widgetLibrary.X 

eg. require( “widget” ) with require ( “widgetLibrary.widget” ) 

works now.