
The methodology used to generate this CL is documented in https://crbug.com/1098010#c95. No-Try: true Bug: 1098010 Change-Id: I4bd37f76f2cc56763fc4018087890eae3c92c700 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3899419 Reviewed-by: Mark Mentovai <mark@chromium.org> Commit-Queue: Avi Drissman <avi@chromium.org> Owners-Override: Avi Drissman <avi@chromium.org> Auto-Submit: Avi Drissman <avi@chromium.org> Cr-Commit-Position: refs/heads/main@{#1047649}
31 lines
953 B
C++
31 lines
953 B
C++
// Copyright 2013 The Chromium Authors
|
|
// Use of this source code is governed by a BSD-style license that can be
|
|
// found in the LICENSE file.
|
|
|
|
#ifndef UI_VIEWS_RECT_BASED_TARGETING_UTILS_H_
|
|
#define UI_VIEWS_RECT_BASED_TARGETING_UTILS_H_
|
|
|
|
#include "ui/views/views_export.h"
|
|
|
|
namespace gfx {
|
|
class Point;
|
|
class Rect;
|
|
} // namespace gfx
|
|
|
|
namespace views {
|
|
|
|
// Returns true if |rect| is 1x1.
|
|
VIEWS_EXPORT bool UsePointBasedTargeting(const gfx::Rect& rect);
|
|
|
|
// Returns the percentage of |rect_1|'s area that is covered by |rect_2|.
|
|
VIEWS_EXPORT float PercentCoveredBy(const gfx::Rect& rect_1,
|
|
const gfx::Rect& rect_2);
|
|
|
|
// Returns the square of the distance from |point| to the center of |rect|.
|
|
VIEWS_EXPORT int DistanceSquaredFromCenterToPoint(const gfx::Point& point,
|
|
const gfx::Rect& rect);
|
|
|
|
} // namespace views
|
|
|
|
#endif // UI_VIEWS_RECT_BASED_TARGETING_UTILS_H_
|