Getting rid of cocoa_set_font_scale_factor
svn path=/trunk/netsurf/; revision=12042
This commit is contained in:
parent
0fc9da23f6
commit
19c5c44e7a
|
@ -147,7 +147,6 @@ static inline NSRect cocoa_get_caret_rect( BrowserView *view )
|
|||
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
|
||||
|
||||
current_redraw_browser = browser;
|
||||
cocoa_set_font_scale_factor( browser->scale );
|
||||
|
||||
const NSRect *rects = NULL;
|
||||
NSInteger count = 0;
|
||||
|
|
|
@ -57,7 +57,6 @@
|
|||
[[NSColor clearColor] set];
|
||||
[NSBezierPath fillRect: rect];
|
||||
|
||||
cocoa_set_font_scale_factor( 1.0 );
|
||||
cocoa_set_clip( rect );
|
||||
|
||||
history_redraw( browser->history );
|
||||
|
|
|
@ -124,7 +124,6 @@ static void tree_get_window_dimensions( int *width, int *height, void *data )
|
|||
|
||||
- (void) drawRect: (NSRect) rect inView: (NSView *) view;
|
||||
{
|
||||
cocoa_set_font_scale_factor( 1.0 );
|
||||
tree_draw( tree, 0, 0, cocoa_pt_to_px( NSMinX( rect ) ), cocoa_pt_to_px( NSMinY( rect )),
|
||||
cocoa_pt_to_px( NSWidth( rect ) ), cocoa_pt_to_px( NSHeight( rect ) ) );
|
||||
}
|
||||
|
|
|
@ -22,6 +22,5 @@
|
|||
#import "desktop/plot_style.h"
|
||||
|
||||
void cocoa_draw_string( CGFloat x, CGFloat y, const char *bytes, size_t length, const plot_font_style_t *style );
|
||||
void cocoa_set_font_scale_factor( float newFactor );
|
||||
|
||||
#endif
|
||||
|
|
11
cocoa/font.m
11
cocoa/font.m
|
@ -38,7 +38,6 @@ static NSDictionary *cocoa_font_attributes( const plot_font_style_t *style );
|
|||
|
||||
static NSTextStorage *cocoa_text_storage = nil;
|
||||
static NSTextContainer *cocoa_text_container = nil;
|
||||
static CGFloat cocoa_font_scale_factor = 1.0;
|
||||
|
||||
static bool nsfont_width(const plot_font_style_t *style,
|
||||
const char *string, size_t length,
|
||||
|
@ -106,17 +105,9 @@ const struct font_functions nsfont = {
|
|||
|
||||
#pragma mark -
|
||||
|
||||
void cocoa_set_font_scale_factor( float newFactor )
|
||||
{
|
||||
cocoa_font_scale_factor = newFactor;
|
||||
}
|
||||
|
||||
void cocoa_draw_string( CGFloat x, CGFloat y, const char *bytes, size_t length, const plot_font_style_t *style )
|
||||
{
|
||||
plot_font_style_t actualStyle = *style;
|
||||
actualStyle.size = (CGFloat)actualStyle.size * cocoa_font_scale_factor;
|
||||
|
||||
NSLayoutManager *layout = cocoa_prepare_layout_manager( bytes, length, &actualStyle );
|
||||
NSLayoutManager *layout = cocoa_prepare_layout_manager( bytes, length, style );
|
||||
if (layout == nil) return;
|
||||
|
||||
NSFont *font = [cocoa_text_storage attribute: NSFontAttributeName atIndex: 0 effectiveRange: NULL];
|
||||
|
|
Loading…
Reference in New Issue