summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSven Weidauer <sven.weidauer@gmail.com>2011-01-13 11:15:40 +0000
committerSven Weidauer <sven.weidauer@gmail.com>2011-01-13 11:15:40 +0000
commitb65a405c3e88c9f96620d494bbe0f70552dc4089 (patch)
tree77912f54ed726f0ceb0468350c357978445b6066
parentf47c0f16e270a90319649b0bba7c70797783961e (diff)
downloadnetsurf-b65a405c3e88c9f96620d494bbe0f70552dc4089.tar.gz
netsurf-b65a405c3e88c9f96620d494bbe0f70552dc4089.tar.bz2
Copy scale value from cloned window and setting new clip rect for every drawing operation.
svn path=/trunk/netsurf/; revision=11308
-rw-r--r--cocoa/BrowserView.m5
-rw-r--r--cocoa/gui.m4
2 files changed, 6 insertions, 3 deletions
diff --git a/cocoa/BrowserView.m b/cocoa/BrowserView.m
index c1a88225a..0aed72142 100644
--- a/cocoa/BrowserView.m
+++ b/cocoa/BrowserView.m
@@ -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,
diff --git a/cocoa/gui.m b/cocoa/gui.m
index d7e5b8f79..4864d8897 100644
--- a/cocoa/gui.m
+++ b/cocoa/gui.m
@@ -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];
}