Changeset 11702 in josm for trunk/src/org/openstreetmap
- Timestamp:
- 2017-03-08T21:18:57+01:00 (8 years ago)
- Location:
- trunk/src/org/openstreetmap/josm
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/gui/layer/gpx/GpxDrawHelper.java
r11613 r11702 294 294 295 295 // shrink to range 296 heatMapDrawGain = Math.min(Math.max(-10,heatMapDrawGain), 10);296 heatMapDrawGain = Utils.clamp(heatMapDrawGain, -10, 10); 297 297 298 298 neutralColor = getColor(layerName, true); … … 732 732 733 733 // adjust global settings 734 final int globalLineWidth = Math.min(Math.max(lineWidth, 1), 20);734 final int globalLineWidth = Utils.clamp(lineWidth, 1, 20); 735 735 736 736 // cache scale of view … … 1157 1157 1158 1158 // adjust global settings ( zero = default line width ) 1159 final int globalLineWidth = (0 == lineWidth) ? 1 : Math.min(Math.max(lineWidth, 1), 20);1159 final int globalLineWidth = (0 == lineWidth) ? 1 : Utils.clamp(lineWidth, 1, 20); 1160 1160 1161 1161 // 1st setup virtual paint area ---------------------------------------- -
trunk/src/org/openstreetmap/josm/gui/mappaint/styleelement/NodeElement.java
r11674 r11702 184 184 mapImage.offsetY = Math.round(offsetYF); 185 185 186 mapImage.alpha = Math.min(255, Math.max(0,Main.pref.getInteger("mappaint.icon-image-alpha", 255)));186 mapImage.alpha = Utils.clamp(Main.pref.getInteger("mappaint.icon-image-alpha", 255), 0, 255); 187 187 Integer pAlpha = Utils.colorFloat2int(c.get(keys[ICON_OPACITY_IDX], null, float.class)); 188 188 if (pAlpha != null) { -
trunk/src/org/openstreetmap/josm/io/MultiFetchServerObjectReader.java
r11386 r11702 323 323 // we will run up to MAX_DOWNLOAD_THREADS concurrent fetchers. 324 324 int threadsNumber = Main.pref.getInteger("osm.download.threads", OsmApi.MAX_DOWNLOAD_THREADS); 325 threadsNumber = Math.min(Math.max(threadsNumber, 1), OsmApi.MAX_DOWNLOAD_THREADS);325 threadsNumber = Utils.clamp(threadsNumber, 1, OsmApi.MAX_DOWNLOAD_THREADS); 326 326 final ExecutorService exec = Executors.newFixedThreadPool( 327 327 threadsNumber, Utils.newThreadFactory(getClass() + "-%d", Thread.NORM_PRIORITY));
Note:
See TracChangeset
for help on using the changeset viewer.