void (@NotNull EditorMouseEvent event) { if (info == null) return; Point currentPoint = event.getMouseEvent().getPoint(); MyRenderer renderer = info.inlay.getRenderer(); int xDelta = info.direction.xMultiplier * (currentPoint.x - renderer.getX() - renderer.getWidth()); int yDelta = info.direction.yMultiplier * (currentPoint.y - renderer.getY() - renderer.getHeight()); Dimension size = renderer.getSize(); int newWidth = Math.max(Math.max(info.inlay.getRenderer().getMinimumSize().width, size.width + xDelta), 0); int newHeight = Math.max(Math.max(info.inlay.getRenderer().getMinimumSize().height, size.height + yDelta), 0); renderer.setCustomWidth(newWidth); renderer.setCustomHeight(newHeight); renderer.setSize(newWidth, newHeight); renderer.revalidate(); renderer.repaint(50); scrollTo(renderer.getBounds()); event.consume(); }