@lumino/widgets
Version:
Lumino Widgets
16 lines (13 loc) • 327 B
text/typescript
/*
* Copyright (c) Jupyter Development Team.
* Distributed under the terms of the Modified BSD License.
*/
export namespace Utils {
/**
* Clamp a dimension value to an integer >= 0.
*/
export function clampDimension(value: number): number {
return Math.max(0, Math.floor(value));
}
}
export default Utils;