mirror of
https://github.com/FoggedLens/iD.git
synced 2026-05-18 06:35:20 +02:00
use lodash-es everywhere, replace custom clamp methods with lodash
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
import {
|
||||
select as d3_select
|
||||
} from 'd3-selection';
|
||||
import { clamp } from 'lodash-es';
|
||||
|
||||
import { t } from '../core/localizer';
|
||||
import { dispatch as d3_dispatch } from 'd3-dispatch';
|
||||
@@ -247,10 +248,6 @@ export function uiPhotoviewer(context) {
|
||||
dispatch.call(eventName, target, subtractPadding(utilGetDimensions(target, true), target));
|
||||
}
|
||||
|
||||
function clamp(num, min, max) {
|
||||
return Math.max(min, Math.min(num, max));
|
||||
}
|
||||
|
||||
function stopResize(d3_event) {
|
||||
if (pointerId !== (d3_event.pointerId || 'mouse')) return;
|
||||
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
import {
|
||||
select as d3_select
|
||||
} from 'd3-selection';
|
||||
import { clamp } from 'lodash-es';
|
||||
|
||||
import { prefs } from '../../core/preferences';
|
||||
import { t, localizer } from '../../core/localizer';
|
||||
@@ -27,10 +28,6 @@ export function uiSectionBackgroundDisplayOptions(context) {
|
||||
sharpness: 1
|
||||
};
|
||||
|
||||
function clamp(x, min, max) {
|
||||
return Math.max(min, Math.min(x, max));
|
||||
}
|
||||
|
||||
function updateValue(d, val) {
|
||||
val = clamp(val, _minVal, _maxVal);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user