diff options
author | Adrian Robert <Adrian.B.Robert@gmail.com> | 2009-01-21 17:28:05 +0000 |
---|---|---|
committer | Adrian Robert <Adrian.B.Robert@gmail.com> | 2009-01-21 17:28:05 +0000 |
commit | 4c7077c3f0b190e5c9ddc4a3557f2b926f183e0a (patch) | |
tree | 3a1b7ce6d0a3c4de43f7069c031c16a692df303f /src | |
parent | a9b4df69505cd37d6be04fb493aec803fa1de497 (diff) | |
download | emacs-4c7077c3f0b190e5c9ddc4a3557f2b926f183e0a.tar.gz |
* nsimage.m (EmacsImage+allocInitFromFile:): Set to ignore DPI. (Bug#1316)
Diffstat (limited to 'src')
-rw-r--r-- | src/ChangeLog | 4 | ||||
-rw-r--r-- | src/nsimage.m | 9 |
2 files changed, 12 insertions, 1 deletions
diff --git a/src/ChangeLog b/src/ChangeLog index 75e6549e46c..79f24287812 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,12 +1,16 @@ 2009-01-21 Adrian Robert <Adrian.B.Robert@gmail.com> * nsmenu.m (NSMENUPROFILE): Change #if style. + * nsterm.m: (x_set_frame_alpha): Add prototype. (ns_fake_keydown, EmacsView-keyUp:): New variable and function to handle Ctrl-tab. (Bug#1841) (ns_get_color): Use unsigned long long for scanned hex string value. (ns_term_shutdown): Abort on non SIGTERM signals. + * nsimage.m (EmacsImage+allocInitFromFile:): Set to ignore DPI. + (Bug#1316) + 2009-01-19 Chong Yidong <cyd@stupidchicken.com> * xfaces.c (Finternal_set_lisp_face_attribute, Fx_list_fonts): diff --git a/src/nsimage.m b/src/nsimage.m index 05e6737c95c..f99a9d2a03e 100644 --- a/src/nsimage.m +++ b/src/nsimage.m @@ -163,6 +163,7 @@ static EmacsImage *ImageList = nil; + allocInitFromFile: (Lisp_Object)file { EmacsImage *image = ImageList; + NSImageRep *imgRep; Lisp_Object found; /* look for an existing image of the same name */ @@ -185,12 +186,18 @@ static EmacsImage *ImageList = nil; image = [[EmacsImage alloc] initByReferencingFile: [NSString stringWithUTF8String: SDATA (found)]]; - if ([image bestRepresentationForDevice: nil] == nil) + imgRep = [image bestRepresentationForDevice: nil]; + if (imgRep == nil) { [image release]; return nil; } + /* The next two lines cause the DPI of the image to be ignored. + This seems to be the behavior users expect. */ + [image setScalesWhenResized: YES]; + [image setSize: NSMakeSize([imgRep pixelsWide], [imgRep pixelsHigh])]; + [image setName: [NSString stringWithUTF8String: SDATA (file)]]; [image reference]; ImageList = [image imageListSetNext: ImageList]; |