mirror of
https://github.com/fhem/fhem-mirror.git
synced 2025-05-04 22:19:38 +00:00
55_InfoPanel: fixed bugzilla #8
fixed: handling for background images git-svn-id: https://svn.fhem.de/fhem/trunk@8168 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
parent
16445aa777
commit
2b33df6872
@ -45,7 +45,8 @@
|
|||||||
# - removed: trashcan due to performance issues
|
# - removed: trashcan due to performance issues
|
||||||
# - added: break condition for includes
|
# - added: break condition for includes
|
||||||
# 2015-02-24 - 8092 - added: longpoll support (experimental)
|
# 2015-02-24 - 8092 - added: longpoll support (experimental)
|
||||||
# 2015-02-25 - - changed: iframe handling for secret div
|
# 2015-02-25 - 8095 - changed: iframe handling for secret div
|
||||||
|
# 2015-03-07 - - fixed: handling for bg img (Bugzilla #8)
|
||||||
#
|
#
|
||||||
##############################################
|
##############################################
|
||||||
# $Id: 55_InfoPanel.pm 8095 2015-02-25 10:33:21Z betateilchen $
|
# $Id: 55_InfoPanel.pm 8095 2015-02-25 10:33:21Z betateilchen $
|
||||||
@ -849,11 +850,19 @@ sub btIP_returnSVG {
|
|||||||
my $bgwidth = $info->{width};
|
my $bgwidth = $info->{width};
|
||||||
my $bgheight = $info->{height};
|
my $bgheight = $info->{height};
|
||||||
my ($u,$v) = ($bgwidth/$width, $bgheight/$height);
|
my ($u,$v) = ($bgwidth/$width, $bgheight/$height);
|
||||||
|
my ($w,$h);
|
||||||
|
if($u>$v) {
|
||||||
|
$w= $width;
|
||||||
|
$h= $bgheight/$u;
|
||||||
|
} else {
|
||||||
|
$h= $height;
|
||||||
|
$w= $bgwidth/$v;
|
||||||
|
}
|
||||||
my $scale = ($u>$v) ? 1/$u : 1/$v;
|
my $scale = ($u>$v) ? 1/$u : 1/$v;
|
||||||
my ($bgx,$bgy) = (0,0);
|
my ($bgx,$bgy) = (0,0);
|
||||||
$bgx = ($width - $bgwidth/$u)/2 if AttrVal($name,'bgcenter',1);
|
$bgx = ($width - $w)/2 if AttrVal($name,'bgcenter',1);
|
||||||
$bgy = ($height - $bgheight/$u)/2 if AttrVal($name,'bgcenter',1);
|
$bgy = ($height - $h)/2 if AttrVal($name,'bgcenter',1);
|
||||||
($output,undef,undef) = btIP_itemImg('bgImage',$bgx,$bgy,$scale,'file',$bgfile,undef);
|
($output,undef,undef) = btIP_itemImg('bgImage',$bgx,$bgy,$scale,undef,'file',$bgfile,undef);
|
||||||
my $opacity = AttrVal($name,'bgopacity',1);
|
my $opacity = AttrVal($name,'bgopacity',1);
|
||||||
$output =~ s/<image\ /<image\ opacity="$opacity" /;
|
$output =~ s/<image\ /<image\ opacity="$opacity" /;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user