It is much better with the fix. We don't count margins, so the aspect
ratio is still not valid for narrow images.

Line in fileItem.js

let width = Prefs.getDesiredWidth(scaleFactor, 0)

was also erroneous, because margins are not 0 (at least, with default
theme).

Here is how the margins are being calculated:

        this._extra_width =  themeNode.get_margin(St.Side.LEFT) +
                             themeNode.get_margin(St.Side.RIGHT) +
                             themeNode.get_border_width(St.Side.LEFT) +
                             themeNode.get_border_width(St.Side.RIGHT) +
                             themeNode.get_horizontal_padding();
        this._extra_height = themeNode.get_margin(St.Side.TOP) +
                             themeNode.get_margin(St.Side.BOTTOM) +
                             themeNode.get_border_width(St.Side.TOP) +
                             themeNode.get_border_width(St.Side.BOTTOM) +
                             themeNode.get_vertical_padding();

(they are used in Prefs.getDesiredWidth and Prefs.getDesiredHeight
functions)

Aspect ratio is still not correct for narrow images. To reproduce,
create an image that has aspect ratio ~0.5 (e.g. width = 250 and height
= 500).

-- 
You received this bug notification because you are a member of Desktop
Packages, which is subscribed to gnome-shell-extension-desktop-icons in
Ubuntu.
https://bugs.launchpad.net/bugs/1868529

Title:
  Stretched image previews on desktop

Status in gnome-shell-extension-desktop-icons:
  Unknown
Status in gnome-shell-extension-desktop-icons package in Ubuntu:
  Fix Released

Bug description:
  After upgrade to 20.04 desktop previews of pictures and documents
  became stretched. The regular previews in Nautilus have normal sizes.
  See attached pic

  ProblemType: Bug
  DistroRelease: Ubuntu 20.04
  Package: gnome-shell-extension-desktop-icons 19.10.2+git20200223-1
  ProcVersionSignature: Ubuntu 5.4.0-18.22-generic 5.4.24
  Uname: Linux 5.4.0-18-generic x86_64
  NonfreeKernelModules: nvidia_modeset nvidia wl
  ApportVersion: 2.20.11-0ubuntu21
  Architecture: amd64
  CurrentDesktop: ubuntu:GNOME
  Date: Mon Mar 23 11:44:13 2020
  PackageArchitecture: all
  ProcEnviron:
   TERM=xterm-256color
   PATH=(custom, no user)
   XDG_RUNTIME_DIR=<set>
   LANG=ru_RU.UTF-8
   SHELL=/bin/bash
  SourcePackage: gnome-shell-extension-desktop-icons
  UpgradeStatus: No upgrade log present (probably fresh install)

To manage notifications about this bug go to:
https://bugs.launchpad.net/gnome-shell-extension-desktop-icons/+bug/1868529/+subscriptions

-- 
Mailing list: https://launchpad.net/~desktop-packages
Post to     : desktop-packages@lists.launchpad.net
Unsubscribe : https://launchpad.net/~desktop-packages
More help   : https://help.launchpad.net/ListHelp

Reply via email to