diff options
Diffstat (limited to 'fpdfsdk/pdfwindow/PWL_Caret.cpp')
-rw-r--r-- | fpdfsdk/pdfwindow/PWL_Caret.cpp | 18 |
1 files changed, 8 insertions, 10 deletions
diff --git a/fpdfsdk/pdfwindow/PWL_Caret.cpp b/fpdfsdk/pdfwindow/PWL_Caret.cpp index e263a79065..3360bbf62a 100644 --- a/fpdfsdk/pdfwindow/PWL_Caret.cpp +++ b/fpdfsdk/pdfwindow/PWL_Caret.cpp @@ -40,19 +40,17 @@ void CPWL_Caret::DrawThisAppearance(CFX_RenderDevice* pDevice, FX_FLOAT fCaretBottom = rcRect.bottom; if (!rcClip.IsEmpty()) { rcRect.Intersect(rcClip); - if (!rcRect.IsEmpty()) { - fCaretTop = rcRect.top; - fCaretBottom = rcRect.bottom; - path.AppendPoint(fCaretX, fCaretBottom, FXPT_TYPE::MoveTo, false); - path.AppendPoint(fCaretX, fCaretTop, FXPT_TYPE::LineTo, false); - } else { + if (rcRect.IsEmpty()) return; - } - } else { - path.AppendPoint(fCaretX, fCaretBottom, FXPT_TYPE::MoveTo, false); - path.AppendPoint(fCaretX, fCaretTop, FXPT_TYPE::LineTo, false); + + fCaretTop = rcRect.top; + fCaretBottom = rcRect.bottom; } + path.AppendPoint(CFX_PointF(fCaretX, fCaretBottom), FXPT_TYPE::MoveTo, + false); + path.AppendPoint(CFX_PointF(fCaretX, fCaretTop), FXPT_TYPE::LineTo, false); + CFX_GraphStateData gsd; gsd.m_LineWidth = m_fWidth; pDevice->DrawPath(&path, pUser2Device, &gsd, 0, ArgbEncode(255, 0, 0, 0), |