diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/xdisp.c | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/src/xdisp.c b/src/xdisp.c index 9b5b7edf035..6ed5fd151d6 100644 --- a/src/xdisp.c +++ b/src/xdisp.c | |||
| @@ -17622,6 +17622,15 @@ calc_pixel_width_or_height (res, it, prop, font, width_p, align_to) | |||
| 17622 | if (pixels > 0) | 17622 | if (pixels > 0) |
| 17623 | { | 17623 | { |
| 17624 | double ppi; | 17624 | double ppi; |
| 17625 | #ifdef HAVE_WINDOW_SYSTEM | ||
| 17626 | if (FRAME_WINDOW_P (it->f) | ||
| 17627 | && (ppi = (width_p | ||
| 17628 | ? FRAME_X_DISPLAY_INFO (it->f)->resx | ||
| 17629 | : FRAME_X_DISPLAY_INFO (it->f)->resy), | ||
| 17630 | ppi > 0)) | ||
| 17631 | return OK_PIXELS (ppi / pixels); | ||
| 17632 | #endif | ||
| 17633 | |||
| 17625 | if ((ppi = NUMVAL (Vdisplay_pixels_per_inch), ppi > 0) | 17634 | if ((ppi = NUMVAL (Vdisplay_pixels_per_inch), ppi > 0) |
| 17626 | || (CONSP (Vdisplay_pixels_per_inch) | 17635 | || (CONSP (Vdisplay_pixels_per_inch) |
| 17627 | && (ppi = (width_p | 17636 | && (ppi = (width_p |
| @@ -23056,7 +23065,7 @@ of the top or bottom of the window. */); | |||
| 23056 | scroll_margin = 0; | 23065 | scroll_margin = 0; |
| 23057 | 23066 | ||
| 23058 | DEFVAR_LISP ("display-pixels-per-inch", &Vdisplay_pixels_per_inch, | 23067 | DEFVAR_LISP ("display-pixels-per-inch", &Vdisplay_pixels_per_inch, |
| 23059 | doc: /* Pixels per inch on current display. | 23068 | doc: /* Pixels per inch value for non-window system displays. |
| 23060 | Value is a number or a cons (WIDTH-DPI . HEIGHT-DPI). */); | 23069 | Value is a number or a cons (WIDTH-DPI . HEIGHT-DPI). */); |
| 23061 | Vdisplay_pixels_per_inch = make_float (72.0); | 23070 | Vdisplay_pixels_per_inch = make_float (72.0); |
| 23062 | 23071 | ||