1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-26 16:07:45 +00:00

LibPDF+MacPDF: Clip text, and add a debug option for disabling it

This commit is contained in:
Nico Weber 2024-01-19 20:01:23 -08:00 committed by Andreas Kling
parent 90fdf738a1
commit a0462f495c
7 changed files with 30 additions and 0 deletions

View file

@ -177,6 +177,10 @@ static NSBitmapImageRep* ns_from_gfx(NonnullRefPtr<Gfx::Bitmap> bitmap_p)
[item setState:_preferences.clip_paths ? NSControlStateValueOn : NSControlStateValueOff];
return _doc ? YES : NO;
}
if ([item action] == @selector(toggleClipText:)) {
[item setState:_preferences.clip_text ? NSControlStateValueOn : NSControlStateValueOff];
return _doc ? YES : NO;
}
return NO;
}
@ -204,6 +208,14 @@ static NSBitmapImageRep* ns_from_gfx(NonnullRefPtr<Gfx::Bitmap> bitmap_p)
}
}
- (IBAction)toggleClipText:(id)sender
{
if (_doc) {
_preferences.clip_text = !_preferences.clip_text;
[self invalidateCachedBitmap];
}
}
- (void)keyDown:(NSEvent*)event
{
// Calls moveLeft: or moveRight: below.