@Override
  public @NotNull LogicalPosition xyToLogicalPosition(@NotNull Point p) {
    return ReadAction.compute(() -> {
      Point pp = p.x >= 0 && p.y >= 0 ? p : new Point(Math.max(p.x, 0), Math.max(p.y, 0));
      return visualToLogicalPosition(xyToVisualPosition(pp));
    });
  }
@Override
  public @NotNull LogicalPosition xyToLogicalPosition(@NotNull Point p)