Skip to content

Commit

Permalink
Take care of GDI+
Browse files Browse the repository at this point in the history
  • Loading branch information
skyline75489 committed Nov 8, 2019
1 parent 52cffd5 commit d1f4634
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 8 deletions.
8 changes: 5 additions & 3 deletions src/renderer/base/RenderClusterIterator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,8 @@ RenderClusterIterator& RenderClusterIterator::operator+=(const ptrdiff_t& moveme
size_t cols = 0;
while (move > 0 && !_exceeded)
{
if (!(*newCellIter).DbcsAttr().IsTrailing())
bool skip = (*newCellIter).DbcsAttr().IsTrailing();
if (!skip)
{
cols += (*newCellIter).Columns();
}
Expand All @@ -65,9 +66,10 @@ RenderClusterIterator& RenderClusterIterator::operator+=(const ptrdiff_t& moveme
}
while (move < 0 && !_exceeded)
{
if (!(*newCellIter).DbcsAttr().IsTrailing())
bool skip = (*newCellIter).DbcsAttr().IsTrailing();
if (!skip)
{
cols += (*newCellIter).Columns();
cols -= (*newCellIter).Columns();
}
--newCellIter;
_exceeded = !(newCellIter && (*newCellIter).TextAttr() == _attr);
Expand Down
8 changes: 4 additions & 4 deletions src/renderer/gdi/paint.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -314,15 +314,15 @@ using namespace Microsoft::Console::Render;
while (clusterIter)
{
const auto& cluster = (*clusterIter);
const auto columnCount = cluster.GetColumns();

// Our GDI renderer hasn't and isn't going to handle things above U+FFFF or sequences.
// So replace anything complicated with a replacement character for drawing purposes.
pwsPoly += cluster.GetTextAsSingle();
rgdxPoly.emplace_back(gsl::narrow<int>(cluster.GetColumns()) * coordFontSize.X);
rgdxPoly.emplace_back(gsl::narrow<int>(columnCount) * coordFontSize.X);
cchCharWidths += rgdxPoly.at(i);

const auto columnCount = cluster.GetColumns();

++clusterIter;
clusterIter += columnCount > 0 ? columnCount : 1;
++i;
}

Expand Down
2 changes: 1 addition & 1 deletion src/renderer/vt/ut_lib/vt.unittest.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,5 @@
<!-- DONT ADD NEW FILES HERE, ADD THEM TO vt-renderer-common.vcxitems -->
<!-- Careful reordering these. Some default props (contained in these files) are order sensitive. -->
<Import Project="$(SolutionDir)src\common.build.post.props" />
<!-- <Import Project="$(SolutionDir)src\common.build.tests.props" /> -->
<Import Project="$(SolutionDir)src\common.build.tests.props" />
</Project>

0 comments on commit d1f4634

Please sign in to comment.