X-Git-Url: http://git.osdn.net/view?p=pettanr%2Fpettanr.git;a=blobdiff_plain;f=app%2Fmodels%2Fground_picture.rb;h=779848dcd73ddc17129310469d0bb4f1fa919a26;hp=1564b2a83b5ab9647fab04e07387c8139d5be482;hb=ac6610b290db53f3914b593963fef972eb4cfa82;hpb=a8af764be9b48ad0bf9eaca3e90f48af2c62ee3c diff --git a/app/models/ground_picture.rb b/app/models/ground_picture.rb index 1564b2a8..779848dc 100644 --- a/app/models/ground_picture.rb +++ b/app/models/ground_picture.rb @@ -59,9 +59,15 @@ class GroundPicture < Peta::Element self.owner_model.visible? operators end - def opt_div_style full_url, spot = nil, opacity = 20 - o = (spot and spot != self) ? "opacity: #{opacity.to_f/100}; filter:alpha(opacity=#{opacity});" : '' - "position: absolute; width:#{self.get_panel.width}px; height:#{self.get_panel.height}px; top: 0px; left: 0px; z-index:#{self.z}; background-image: url(#{full_url}); background-repeat: #{self.repeat_text}; background-position: #{self.x}px #{self.y}px; #{o}" + def style spot = nil, opacity = 20 + r = { + 'position' => 'absolute', 'top' => '0px', 'left' => '0px', 'z-index' => self.z, + 'background-image' => "url(#{self.picture.url})", + 'background-repeat' => self.repeat_text, + 'background-position' => "#{self.x}px #{self.y}px" + } + self.merge_opacity(r, opacity) if spot and spot != self + r end def tmb_opt_img_tag