File tree Expand file tree Collapse file tree 2 files changed +3
-5
lines changed Expand file tree Collapse file tree 2 files changed +3
-5
lines changed Original file line number Diff line number Diff line change @@ -174,9 +174,7 @@ export class DeviceManager implements IDeviceManager {
174174 apiLevel : platformVersion || args . appiumCaps . platformVersion ,
175175 config : { "density" : args . appiumCaps . density , "offsetPixels" : args . appiumCaps . offsetPixels }
176176 }
177-
178- delete args . appiumCaps . density ;
179- delete args . appiumCaps . offsetPixels ;
177+
180178 DeviceManager . cleanUnsetProperties ( device ) ;
181179
182180 return device ;
Original file line number Diff line number Diff line change @@ -102,9 +102,9 @@ export class ImageHelper {
102102 ImageHelper . fullClone ( this . _args . device . viewportRect , this . _defaultOptions . cropRectangle )
103103 }
104104 if ( ! this . _defaultOptions . cropRectangle
105- || ! isNumber ( this . _defaultOptions . cropRectangle . y ) ) {
105+ || ! isNumber ( this . _defaultOptions . cropRectangle . y ) || this . _args . appiumCaps . offsetPixels > 0 ) {
106106 this . _defaultOptions . cropRectangle = this . _defaultOptions . cropRectangle || { } ;
107- this . _defaultOptions . cropRectangle . y = this . _args . device . config . offsetPixels || 0 ;
107+ this . _defaultOptions . cropRectangle . y = this . _args . appiumCaps . offsetPixels || this . _args . device . config . offsetPixels || 0 ;
108108 this . _defaultOptions . cropRectangle . x = 0 ;
109109 if ( this . _args . device . deviceScreenSize && this . _args . device . deviceScreenSize . width && this . _args . device . deviceScreenSize . height ) {
110110 this . _defaultOptions . cropRectangle . height = this . _args . device . deviceScreenSize . height - this . _defaultOptions . cropRectangle . y ;
You can’t perform that action at this time.
0 commit comments