Manually roll src/third_party/pdfium/ 2b2e1584e..1d3378762 (1 commit)
https://pdfium.googlesource.com/pdfium.git/+log/2b2e1584ef6d..1d3378762d82 $ git log 2b2e1584e..1d3378762 --date=short --no-merges --format='%ad %ae %s' 2020-09-18 thestig Fix FPDFText_GetCharBox() returning excessively tall char boxes. With the FPDFText_GetCharBox() change, some code in pdf/ need to be adjusted, so PDFiumPageTextTests pass: 1) In TestHighlightTextRunInfo, a text run that only contains a space used to be 25 units tall. Now it is 14, which better matches the surrounding text runs and no longer sticks out. 2) In TestTextRunBounds, the leading space is now shorter, but the rect to pixel conversion rounds it down to 0. Change FloatPageRectToPixelRect() to change rect dimensions that would round down to 0 to round up to 1 instead. Change-Id: I887e0567e8a9372690e5fcc0f82d96c4852df80a Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2425751 Commit-Queue: Lei Zhang <thestig@chromium.org> Reviewed-by: Ankit Kumar 🌪️ <ankk@microsoft.com> Reviewed-by: Dominic Mazzoni <dmazzoni@chromium.org> Cr-Commit-Position: refs/heads/master@{#809994}
This commit is contained in:
2
DEPS
2
DEPS
@ -215,7 +215,7 @@ vars = {
|
||||
# Three lines of non-changing comments so that
|
||||
# the commit queue can handle CLs rolling PDFium
|
||||
# and whatever else without interference from each other.
|
||||
'pdfium_revision': '2b2e1584ef6ddc352d829848a1433cdd036e965e',
|
||||
'pdfium_revision': '1d3378762d8282b26b9200cf26a2bedcb0bd4155',
|
||||
# Three lines of non-changing comments so that
|
||||
# the commit queue can handle CLs rolling BoringSSL
|
||||
# and whatever else without interference from each other.
|
||||
|
@ -84,11 +84,20 @@ gfx::RectF FloatPageRectToPixelRect(FPDF_PAGE page, const gfx::RectF& input) {
|
||||
if (max_y < min_y)
|
||||
std::swap(min_y, max_y);
|
||||
|
||||
// Make sure small but non-zero dimensions for |input| does not get rounded
|
||||
// down to 0.
|
||||
int width = max_x - min_x;
|
||||
int height = max_y - min_y;
|
||||
if (width == 0 && input.width())
|
||||
width = 1;
|
||||
if (height == 0 && input.height())
|
||||
height = 1;
|
||||
|
||||
gfx::RectF output_rect(
|
||||
ConvertUnitDouble(min_x, kPointsPerInch, kPixelsPerInch),
|
||||
ConvertUnitDouble(min_y, kPointsPerInch, kPixelsPerInch),
|
||||
ConvertUnitDouble(max_x - min_x, kPointsPerInch, kPixelsPerInch),
|
||||
ConvertUnitDouble(max_y - min_y, kPointsPerInch, kPixelsPerInch));
|
||||
ConvertUnitDouble(width, kPointsPerInch, kPixelsPerInch),
|
||||
ConvertUnitDouble(height, kPointsPerInch, kPixelsPerInch));
|
||||
return output_rect;
|
||||
}
|
||||
|
||||
|
@ -440,7 +440,7 @@ TEST_F(PDFiumPageTextTest, TestHighlightTextRunInfo) {
|
||||
PP_PrivateDirection::PP_PRIVATEDIRECTION_LTR, kExpectedStyle},
|
||||
{7, gfx::RectF(106.66666f, 198.66667f, 73.333336f, 18.666672f),
|
||||
PP_PrivateDirection::PP_PRIVATEDIRECTION_LTR, kExpectedStyle},
|
||||
{2, gfx::RectF(181.33333f, 192.0f, 16.0f, 25.333344f),
|
||||
{2, gfx::RectF(181.33333f, 202.66667f, 16.0f, 14.66667f),
|
||||
PP_PrivateDirection::PP_PRIVATEDIRECTION_NONE, kExpectedStyle},
|
||||
{2, gfx::RectF(198.66667f, 202.66667f, 21.333328f, 10.666672f),
|
||||
PP_PrivateDirection::PP_PRIVATEDIRECTION_LTR, kExpectedStyle}};
|
||||
|
Reference in New Issue
Block a user