mirror of
https://github.com/XITRIX/NXKit.git
synced 2026-05-30 11:46:52 +00:00
15 lines
405 B
C++
15 lines
405 B
C++
//
|
|
// Created by Даниил Виноградов on 12.01.2024.
|
|
//
|
|
|
|
#include <UIScrollViewExtensions/RubberBand.h>
|
|
|
|
namespace NXKit {
|
|
|
|
NXPoint RubberBand::clamp(NXPoint point) const{
|
|
auto x = Geometry::rubberBandClamp(point.x, coeff, dims.width, bounds.minX(), bounds.maxX());
|
|
auto y = Geometry::rubberBandClamp(point.y, coeff, dims.height, bounds.minY(), bounds.maxY());
|
|
return {x, y};
|
|
}
|
|
|
|
} |