Website : rimsha.abasa.com
backdoor
Home
Console
Upload
information
Create File
Create Folder
About
Tools
:
/
var
/
canvas
/
node_modules
/
react-beautiful-dnd
/
src
/
state
/
Filename :
get-max-scroll.js
back
Copy
// @flow import { type Position } from 'css-box-model'; import { subtract } from './position'; type Args = {| scrollHeight: number, scrollWidth: number, height: number, width: number, |}; export default ({ scrollHeight, scrollWidth, height, width, }: Args): Position => { const maxScroll: Position = subtract( // full size { x: scrollWidth, y: scrollHeight }, // viewport size { x: width, y: height }, ); const adjustedMaxScroll: Position = { x: Math.max(0, maxScroll.x), y: Math.max(0, maxScroll.y), }; return adjustedMaxScroll; };