MacPDF: FixedPoint hack fix courtesy of trflynn

Also some minor cleanups, and pick a different default document.
This commit is contained in:
Nico Weber 2023-07-23 10:29:46 -04:00 committed by Andreas Kling
parent ef91ced481
commit 77b311f00a
2 changed files with 4 additions and 5 deletions

View file

@ -7,7 +7,10 @@
#pragma once
// Several AK types conflict with MacOS types.
#define FixedPoint FixedPointMacOS
#import <Cocoa/Cocoa.h>
#undef FixedPoint
@interface LagomPDFView : NSView
{

View file

@ -7,8 +7,6 @@
#import "LagomPDFView.h"
// #define USING_AK_GLOBALLY 0
#include <LibCore/File.h>
#include <LibCore/MappedFile.h>
#include <LibGfx/Bitmap.h>
@ -70,9 +68,7 @@ static NSBitmapImageRep* ns_from_gfx(NonnullRefPtr<Gfx::Bitmap> bitmap_p)
auto source_root = DeprecatedString("/Users/thakis/src/serenity");
Gfx::FontDatabase::set_default_fonts_lookup_path(DeprecatedString::formatted("{}/Base/res/fonts", source_root));
NSLog(@"before file");
_file = TRY(Core::MappedFile::map("/Users/thakis/src/hack/sample.pdf"sv));
NSLog(@"got file");
_file = TRY(Core::MappedFile::map("/Users/thakis/Downloads/pdf_reference_1-7.pdf"sv));
auto document = TRY(PDF::Document::create(_file->bytes()));
TRY(document->initialize());
return document;