mirror of
https://github.com/FoggedLens/iD.git
synced 2026-05-19 23:14:47 +02:00
Avoid reflow caused by restriction editor checking its dimensions
This commit is contained in:
@@ -235,7 +235,14 @@ export function uiFieldRestrictions(field, context) {
|
||||
var filter = utilFunctor(true);
|
||||
var projection = geoRawMercator();
|
||||
|
||||
var d = utilGetDimensions(selection);
|
||||
// Reflow warning: `utilGetDimensions` calls `getBoundingClientRect`
|
||||
// Instead of asking the restriction-container for its dimensions,
|
||||
// we can ask the #sidebar, which can have its dimensions cached.
|
||||
// width: calc as sidebar - padding
|
||||
// height: hardcoded (from `80_app.css`)
|
||||
// var d = utilGetDimensions(selection);
|
||||
var sdims = utilGetDimensions(d3_select('#sidebar'));
|
||||
var d = [ sdims[0] - 50, 370 ];
|
||||
var c = geoVecScale(d, 0.5);
|
||||
var z = 22;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user