Copy scale value from cloned window and setting new clip rect for every drawing operation.

svn path=/trunk/netsurf/; revision=11308
This commit is contained in:
Sven Weidauer 2011-01-13 11:15:40 +00:00
parent f47c0f16e2
commit b65a405c3e
2 changed files with 6 additions and 3 deletions

View File

@ -87,15 +87,14 @@ static inline NSRect cocoa_get_caret_rect( BrowserView *view )
if (NULL == browser->current_content) return;
NSRect frame = [self bounds];
plot.clip(0, 0, frame.size.width, frame.size.height);
const NSRect *rects = NULL;
NSInteger count = 0;
[self getRectsBeingDrawn: &rects count: &count];
for (NSInteger i = 0; i < count; i++) {
plot.clip( NSMinX( rects[i] ), NSMinY( rects[i]), NSMaxX( rects[i] ), NSMaxY( rects[i] ) );
content_redraw(browser->current_content,
0,
0,

View File

@ -24,6 +24,7 @@
#import "desktop/gui.h"
#import "desktop/netsurf.h"
#import "desktop/browser.h"
#import "desktop/options.h"
char *default_stylesheet_url;
char *adblock_stylesheet_url;
@ -60,6 +61,9 @@ struct browser_window;
struct gui_window *gui_create_browser_window(struct browser_window *bw,
struct browser_window *clone, bool new_tab)
{
if (clone != NULL) bw->scale = clone->scale;
else bw->scale = (float) option_scale / 100;
return (struct gui_window *)[[BrowserWindow alloc] initWithBrowser: bw];
}