@@ -34,7 +34,8 @@ export abstract class BaseFitPositionStrategy extends ConnectedPositioningStrate
34
34
connectedFit . targetRect ,
35
35
connectedFit . contentElementRect ,
36
36
this . settings . horizontalStartPoint ,
37
- this . settings . horizontalDirection ) ;
37
+ this . settings . horizontalDirection ,
38
+ connectedFit . xOffset ) ;
38
39
connectedFit . right = connectedFit . left + connectedFit . contentElementRect . width ;
39
40
connectedFit . fitHorizontal =
40
41
connectedFit . viewPortRect . left < connectedFit . left && connectedFit . right < connectedFit . viewPortRect . right ;
@@ -43,7 +44,8 @@ export abstract class BaseFitPositionStrategy extends ConnectedPositioningStrate
43
44
connectedFit . targetRect ,
44
45
connectedFit . contentElementRect ,
45
46
this . settings . verticalStartPoint ,
46
- this . settings . verticalDirection ) ;
47
+ this . settings . verticalDirection ,
48
+ connectedFit . yOffset ) ;
47
49
connectedFit . bottom = connectedFit . top + connectedFit . contentElementRect . height ;
48
50
connectedFit . fitVertical =
49
51
connectedFit . viewPortRect . top < connectedFit . top && connectedFit . bottom < connectedFit . viewPortRect . bottom ;
@@ -58,8 +60,9 @@ export abstract class BaseFitPositionStrategy extends ConnectedPositioningStrate
58
60
* @param direction Direction in which to show the element
59
61
*/
60
62
protected calculateLeft (
61
- targetRect : ClientRect , elementRect : ClientRect , startPoint : HorizontalAlignment , direction : HorizontalAlignment ) : number {
62
- return targetRect . right + targetRect . width * startPoint + elementRect . width * direction ;
63
+ targetRect : ClientRect , elementRect : ClientRect , startPoint : HorizontalAlignment , direction : HorizontalAlignment , offset ?: number ) :
64
+ number {
65
+ return targetRect . right + targetRect . width * startPoint + elementRect . width * direction + offset ;
63
66
}
64
67
65
68
/**
@@ -71,8 +74,9 @@ export abstract class BaseFitPositionStrategy extends ConnectedPositioningStrate
71
74
* @param direction Direction in which to show the element
72
75
*/
73
76
protected calculateTop (
74
- targetRect : ClientRect , elementRect : ClientRect , startPoint : VerticalAlignment , direction : VerticalAlignment ) : number {
75
- return targetRect . bottom + targetRect . height * startPoint + elementRect . height * direction ;
77
+ targetRect : ClientRect , elementRect : ClientRect , startPoint : VerticalAlignment , direction : VerticalAlignment , offset ?: number ) :
78
+ number {
79
+ return targetRect . bottom + targetRect . height * startPoint + elementRect . height * direction + offset ;
76
80
}
77
81
78
82
/**
@@ -95,4 +99,7 @@ export interface ConnectedFit {
95
99
right ?: number ;
96
100
top ?: number ;
97
101
bottom ?: number ;
102
+ xOffset ?: number ;
103
+ yOffset ?: number ;
98
104
}
105
+
0 commit comments