mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-12-04 05:20:30 +00:00
LibPDF: Tolerate integer outline item colors
0000296.pdf from 0000.zip from the pdfa dataset contains `/C [0 0 0]` (as opposed to `/C [0.0 0.0 0.0]`). Make that work. (It's fine per spec.)
This commit is contained in:
parent
c2c37de201
commit
208a058eab
Notes:
sideshowbarker
2024-07-16 22:17:03 +09:00
Author: https://github.com/nico Commit: https://github.com/SerenityOS/serenity/commit/208a058eab Pull-request: https://github.com/SerenityOS/serenity/pull/21584
1 changed files with 3 additions and 3 deletions
|
@ -568,9 +568,9 @@ PDFErrorOr<NonnullRefPtr<OutlineItem>> Document::build_outline_item(NonnullRefPt
|
|||
|
||||
if (outline_item_dict->contains(CommonNames::C)) {
|
||||
auto color_array = TRY(outline_item_dict->get_array(this, CommonNames::C));
|
||||
auto r = static_cast<int>(255.0f * color_array->at(0).get<float>());
|
||||
auto g = static_cast<int>(255.0f * color_array->at(1).get<float>());
|
||||
auto b = static_cast<int>(255.0f * color_array->at(2).get<float>());
|
||||
auto r = static_cast<int>(255.0f * color_array->at(0).to_float());
|
||||
auto g = static_cast<int>(255.0f * color_array->at(1).to_float());
|
||||
auto b = static_cast<int>(255.0f * color_array->at(2).to_float());
|
||||
outline_item->color = Color(r, g, b);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue