private fun iconBoundsIntersectBar(barBounds: RectF, icon: Rect, scaleFactor: Double): Boolean { val iconL: Int = icon.left + javax.swing.Spring.scale(icon.width(), scaleFactor.toFloat()) val iconT: Int = icon.top + javax.swing.Spring.scale(icon.height(), scaleFactor.toFloat()) val iconR: Int = icon.right - javax.swing.Spring.scale(icon.width(), scaleFactor.toFloat()) val iconB: Int = icon.bottom - javax.swing.Spring.scale(icon.height(), scaleFactor.toFloat()) return barBounds.intersects( iconL.toFloat(), iconT.toFloat(), iconR.toFloat(), iconB.toFloat() ) }
Helper method for calculating intersections for control icons and bars .