diff options
| author | Zufu Liu <unknown> | 2020-02-09 09:19:56 +1100 |
|---|---|---|
| committer | Zufu Liu <unknown> | 2020-02-09 09:19:56 +1100 |
| commit | 90a498aa44da18855534f4e8b001de07460ccb72 (patch) | |
| tree | af1d8fef272b53b1b0d261eb1a24314fbaba9dbe /include/Platform.h | |
| parent | fb900ef3e4342b79a529a99fd120e628ab53f400 (diff) | |
| download | scintilla-mirror-90a498aa44da18855534f4e8b001de07460ccb72.tar.gz | |
Backport: Feature [feature-requests:#1340] Move and use Point functions to avoid casting.
Backport of changeset 7976:4ba647207671.
Diffstat (limited to 'include/Platform.h')
| -rw-r--r-- | include/Platform.h | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/include/Platform.h b/include/Platform.h index bb453e20b..b678deadc 100644 --- a/include/Platform.h +++ b/include/Platform.h @@ -104,7 +104,7 @@ public: constexpr explicit Point(XYPOSITION x_=0, XYPOSITION y_=0) noexcept : x(x_), y(y_) { } - static Point FromInts(int x_, int y_) noexcept { + static constexpr Point FromInts(int x_, int y_) noexcept { return Point(static_cast<XYPOSITION>(x_), static_cast<XYPOSITION>(y_)); } @@ -139,7 +139,7 @@ public: left(left_), top(top_), right(right_), bottom(bottom_) { } - static PRectangle FromInts(int left_, int top_, int right_, int bottom_) noexcept { + static constexpr PRectangle FromInts(int left_, int top_, int right_, int bottom_) noexcept { return PRectangle(static_cast<XYPOSITION>(left_), static_cast<XYPOSITION>(top_), static_cast<XYPOSITION>(right_), static_cast<XYPOSITION>(bottom_)); } |
