diff options
author | Sven Weidauer <sven.weidauer@gmail.com> | 2011-01-27 11:43:48 +0000 |
---|---|---|
committer | Sven Weidauer <sven.weidauer@gmail.com> | 2011-01-27 11:43:48 +0000 |
commit | 3376f7f50ff774030596a2e84dd9f72920ee449c (patch) | |
tree | 54d6f33f418adc27a50e327d909ae5a6c1c55f31 /cocoa/BrowserView.m | |
parent | 73885bf3d0e6ff5438a4d2140dcc29dea924912a (diff) | |
download | netsurf-3376f7f50ff774030596a2e84dd9f72920ee449c.tar.gz netsurf-3376f7f50ff774030596a2e84dd9f72920ee449c.tar.bz2 |
Implemented resolution-independent rendering for the browser view. Still needs to be implemented for the other views.
svn path=/trunk/netsurf/; revision=11507
Diffstat (limited to 'cocoa/BrowserView.m')
-rw-r--r-- | cocoa/BrowserView.m | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/cocoa/BrowserView.m b/cocoa/BrowserView.m index ea5147558..b58466cd1 100644 --- a/cocoa/BrowserView.m +++ b/cocoa/BrowserView.m @@ -27,7 +27,7 @@ #import "desktop/selection.h" #import "cocoa/font.h" - +#import "cocoa/plotter.h" @implementation BrowserView @@ -122,12 +122,12 @@ static inline NSRect cocoa_get_caret_rect( BrowserView *view ) content_redraw(browser->current_content, 0, 0, - NSWidth( frame ), - NSHeight( frame ), - NSMinX( rects[i] ), - NSMinY( rects[i] ), - NSMaxX( rects[i] ), - NSMaxY( rects[i] ), + cocoa_pt_to_px( NSWidth( frame ) ), + cocoa_pt_to_px( NSHeight( frame ) ), + cocoa_pt_to_px( NSMinX( rects[i] ) ), + cocoa_pt_to_px( NSMinY( rects[i] ) ), + cocoa_pt_to_px( NSMaxX( rects[i] ) ), + cocoa_pt_to_px( NSMaxY( rects[i] ) ), browser->scale, 0xFFFFFF); } @@ -165,6 +165,8 @@ static browser_mouse_state cocoa_mouse_flags_for_event( NSEvent *evt ) location.x /= browser->scale; location.y /= browser->scale; } + location.x = cocoa_pt_to_px( location.x ); + location.y = cocoa_pt_to_px( location.y ); return location; } @@ -344,7 +346,7 @@ static browser_mouse_state cocoa_mouse_flags_for_event( NSEvent *evt ) { if (!isResizing) { NSSize frameSize = [[self superview] frame].size; - browser_window_reformat( browser, frameSize.width, frameSize.height ); + browser_window_reformat( browser, cocoa_pt_to_px( frameSize.width ), cocoa_pt_to_px( frameSize.height ) ); } [super adjustFrame]; |