Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clean up til::point/size/rect member usage #14458

Merged
4 commits merged into from
Dec 1, 2022
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/buffer/out/LineRendition.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,19 +25,19 @@ constexpr til::inclusive_rect ScreenToBufferLine(const til::inclusive_rect& line
{
// Use shift right to quickly divide the Left and Right by 2 for double width lines.
const auto scale = lineRendition == LineRendition::SingleWidth ? 0 : 1;
return { line.Left >> scale, line.Top, line.Right >> scale, line.Bottom };
return { line.left >> scale, line.top, line.right >> scale, line.bottom };
}

constexpr til::point ScreenToBufferLine(const til::point& line, const LineRendition lineRendition)
{
// Use shift right to quickly divide the Left and Right by 2 for double width lines.
const auto scale = lineRendition == LineRendition::SingleWidth ? 0 : 1;
return { line.X >> scale, line.Y };
return { line.x >> scale, line.y };
}

constexpr til::inclusive_rect BufferToScreenLine(const til::inclusive_rect& line, const LineRendition lineRendition)
{
// Use shift left to quickly multiply the Left and Right by 2 for double width lines.
const auto scale = lineRendition == LineRendition::SingleWidth ? 0 : 1;
return { line.Left << scale, line.Top, (line.Right << scale) + scale, line.Bottom };
return { line.left << scale, line.top, (line.right << scale) + scale, line.bottom };
}
12 changes: 6 additions & 6 deletions src/buffer/out/cursor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -199,47 +199,47 @@ void Cursor::SetPosition(const til::point cPosition) noexcept
void Cursor::SetXPosition(const til::CoordType NewX) noexcept
{
_RedrawCursor();
_cPosition.X = NewX;
_cPosition.x = NewX;
_RedrawCursor();
ResetDelayEOLWrap();
}

void Cursor::SetYPosition(const til::CoordType NewY) noexcept
{
_RedrawCursor();
_cPosition.Y = NewY;
_cPosition.y = NewY;
_RedrawCursor();
ResetDelayEOLWrap();
}

void Cursor::IncrementXPosition(const til::CoordType DeltaX) noexcept
{
_RedrawCursor();
_cPosition.X += DeltaX;
_cPosition.x += DeltaX;
_RedrawCursor();
ResetDelayEOLWrap();
}

void Cursor::IncrementYPosition(const til::CoordType DeltaY) noexcept
{
_RedrawCursor();
_cPosition.Y += DeltaY;
_cPosition.y += DeltaY;
_RedrawCursor();
ResetDelayEOLWrap();
}

void Cursor::DecrementXPosition(const til::CoordType DeltaX) noexcept
{
_RedrawCursor();
_cPosition.X -= DeltaX;
_cPosition.x -= DeltaX;
_RedrawCursor();
ResetDelayEOLWrap();
}

void Cursor::DecrementYPosition(const til::CoordType DeltaY) noexcept
{
_RedrawCursor();
_cPosition.Y -= DeltaY;
_cPosition.y -= DeltaY;
_RedrawCursor();
ResetDelayEOLWrap();
}
Expand Down
8 changes: 4 additions & 4 deletions src/buffer/out/search.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -158,8 +158,8 @@ til::point Search::s_GetInitialAnchor(const IUiaData& uiaData, const Direction d
textBuffer.GetSize().DecrementInBoundsCircular(anchor);
// If the selection starts at (0, 0), we need to make sure
// it does not exceed the text buffer end position
anchor.X = std::min(textBufferEndPosition.X, anchor.X);
anchor.Y = std::min(textBufferEndPosition.Y, anchor.Y);
anchor.x = std::min(textBufferEndPosition.x, anchor.x);
anchor.y = std::min(textBufferEndPosition.y, anchor.y);
}
return anchor;
}
Expand Down Expand Up @@ -307,8 +307,8 @@ void Search::_UpdateNextPosition()
// Backward: the position of the end of the text buffer
const auto bufferEndPosition = _uiaData.GetTextBufferEndPosition();

if (_coordNext.Y > bufferEndPosition.Y ||
(_coordNext.Y == bufferEndPosition.Y && _coordNext.X > bufferEndPosition.X))
if (_coordNext.y > bufferEndPosition.y ||
(_coordNext.y == bufferEndPosition.y && _coordNext.x > bufferEndPosition.x))
{
if (_direction == Direction::Forward)
{
Expand Down
Loading