src/common/js/winjs/js/ui.js
function ListView_convertCoordinatesByCanvasMargins(coordinates, conversionCallback) {
                    function fix(field, offset) {
                        if (coordinates[field] !== undefined) {
                            coordinates[field] = conversionCallback(coordinates[field], offset);
                        }
                    }

                    var offset;
                    if (this._horizontal()) {
                        offset = this._getCanvasMargins()[this._rtl() ? "right" : "left"];
                        fix("left", offset);
                    } else {
                        offset = this._getCanvasMargins().top;
                        fix("top", offset);
                    }
                    fix("begin", offset);
                    fix("end", offset);

                    return coordinates;
                }
function ListView_convertCoordinatesByCanvasMargins(coordinates, conversionCallback) {
                    function fix(field, offset) {
                        if (coordinates[field] !== undefined) {
                            coordinates[field] = conversionCallback(coordinates[field], offset);
                        }
                    }

                    var offset;
                    if (this._horizontal()) {
                        offset = this._getCanvasMargins()[this._rtl() ? "right" : "left"];
                        fix("left", offset);
                    } else {
                        offset = this._getCanvasMargins().top;
                        fix("top", offset);
                    }
                    fix("begin", offset);
                    fix("end", offset);

                    return coordinates;
                }
function ListView_convertCoordinatesByCanvasMargins ( coordinates , conversionCallback ) { function fix ( field , offset ) { if ( coordinates [ field ] !== undefined ) { coordinates [ field ] = conversionCallback ( coordinates [ field ] , offset ) ; } } var offset ; if ( this . _horizontal ( ) ) { offset = this . _getCanvasMargins ( ) [ this . _rtl ( ) ? "right" : "left" ] ; fix ( "left" , offset ) ; } else { offset = this . _getCanvasMargins ( ) . top ; fix ( "top" , offset ) ; } fix ( "begin" , offset ) ; fix ( "end" , offset ) ; return coordinates ; }
Convert between canvas coordinates and viewport coordinates
Convert between canvas coordinates and viewport coordinates