Ticket #2154: mythgalleryAR.diff
File mythgalleryAR.diff, 2.0 KB (added by , 19 years ago) |
---|
-
glsingleview.cpp
35 35 36 36 #include "glsingleview.h" 37 37 #include "galleryutil.h" 38 #include <X11/Xlib.h> 38 39 39 40 GLSDialog::GLSDialog(const ThumbList& itemList, int pos, int slideShow, 40 41 MythMainWindow *parent, const char *name) … … 574 575 575 576 QImage image(item->path); 576 577 if (!image.isNull()) { 578 // get screen aspect 579 Display *display; 580 display = XOpenDisplay(NULL); 577 581 582 int scr = DefaultScreen(display); 583 int s_height_mm = DisplayHeightMM(display,scr); 584 int s_width_mm = DisplayWidthMM(display,scr); 585 int s_height_px = DisplayHeight(display,scr); 586 int s_width_px = DisplayWidth(display,scr); 587 588 double aspect_h = (double)s_height_px/(double)s_height_mm; 589 double aspect_w = (double)s_width_px/(double)s_width_mm; 590 591 double scale_factor_w = 1; 592 593 scale_factor_w = aspect_w / aspect_h; 594 578 595 int a = m_tex1First ? 0 : 1; 579 596 TexItem& t = m_texItem[a]; 580 597 … … 582 599 t.angle = 0; 583 600 584 601 t.angle = item->GetRotationAngle(); 602 603 t.width = (int)round(image.width() * scale_factor_w); 604 t.height = (int)round(image.height()); 585 605 586 t.width = image.width();587 t.height = image.height();588 589 606 if (t.angle%180 != 0) { 607 t.width = image.width(); 590 608 int tmp = t.width; 591 t.width = t.height ;609 t.width = t.height * scale_factor_w; 592 610 t.height = tmp; 593 611 } 594 612 -
glsingleview.h
85 85 int screenwidth, screenheight; 86 86 float wmult, hmult; 87 87 int m_w, m_h; 88 double scale_factor_w; 88 89 89 90 TexItem m_texItem[2]; 90 91 int m_curr;