@@ -299,7 +299,10 @@ Item {
299299 // these are some of the initial calculations
300300 // before creating the callout frame
301301 preCalculateWidthAndHeight ();
302- adjustRelativePositionOfCanvasFrame (anchorPointx, anchorPointy);
302+ if (platform == " ios" )
303+ adjustRelativePositionOfCanvasFrame (anchorPointx, anchorPointy, calloutLayout .width - 2 * cornerRadius, calloutLayout .height - cornerRadius);
304+ else
305+ adjustRelativePositionOfCanvasFrame (anchorPointx, anchorPointy, rectWidth, rectHeight);
303306
304307 if (leaderPosition !== Enums .LeaderPosition .Automatic )
305308 adjustedLeaderPosition = leaderPosition;
@@ -310,7 +313,11 @@ Item {
310313
311314 // once leader position is finalized
312315 if (findBestLeaderPosition (anchorPointx, anchorPointy)) {
313- adjustRelativePositionOfCanvasFrame (anchorPointx, anchorPointy);
316+ if (platform == " ios" )
317+ adjustRelativePositionOfCanvasFrame (anchorPointx, anchorPointy, calloutLayout .width - 2 * cornerRadius, calloutLayout .height - cornerRadius);
318+ else
319+ adjustRelativePositionOfCanvasFrame (anchorPointx, anchorPointy, rectWidth, rectHeight);
320+
314321
315322 }
316323
@@ -376,7 +383,7 @@ Item {
376383 anchors {
377384 left: parent .left
378385 top: parent .top
379- }
386+ }
380387 columnSpacing: 7 * scaleFactor
381388
382389 Rectangle {
@@ -868,36 +875,36 @@ Item {
868875 }
869876
870877 /* ! \internal */
871- function adjustRelativePositionOfCanvasFrame (screenx , screeny ) {
878+ function adjustRelativePositionOfCanvasFrame (screenx , screeny , calloutWidth , calloutHeight ) {
872879
873880 if (adjustedLeaderPosition === Enums .LeaderPosition .Top ) {
874881 calloutContentFrame .anchors .topMargin = leaderHeight;
875- calloutFrame .x = screenx - rectWidth / 2 ;
882+ calloutFrame .x = screenx - calloutWidth / 2 ;
876883 calloutFrame .y = screeny;
877884 if (debug) {
878885 console .log (" top calloutFrame = " , calloutFrame .x , " " , calloutFrame .y );
879886 }
880887 } else if (adjustedLeaderPosition === Enums .LeaderPosition .Bottom ) {
881- calloutFrame .x = screenx - (rectWidth / 2 );
882- calloutFrame .y = screeny - (leaderHeight + rectHeight );
888+ calloutFrame .x = screenx - (calloutWidth / 2 );
889+ calloutFrame .y = screeny - (leaderHeight + calloutHeight );
883890 if (debug) {
884891 console .log (" bottom calloutFrame = " , calloutFrame .x , " " , calloutFrame .y );
885892 }
886893 } else if (adjustedLeaderPosition === Enums .LeaderPosition .Left ) {
887894 calloutContentFrame .anchors .leftMargin = leaderHeight;
888895 calloutFrame .x = screenx;
889- calloutFrame .y = screeny - rectHeight / 2 ;
896+ calloutFrame .y = screeny - calloutHeight / 2 ;
890897 if (debug) {
891898 console .log (" left calloutFrame = " , calloutFrame .x , " " , calloutFrame .y );
892899 }
893900 } else if (adjustedLeaderPosition === Enums .LeaderPosition .Right ) {
894- calloutFrame .x = screenx - (rectWidth + leaderWidth );
895- calloutFrame .y = screeny - rectHeight / 2 ;
901+ calloutFrame .x = screenx - (calloutWidth + leaderHeight );
902+ calloutFrame .y = screeny - calloutHeight / 2 ;
896903 if (debug) {
897904 console .log (" right calloutFrame = " , calloutFrame .x , " " , calloutFrame .y );
898905 }
899906 } else if (adjustedLeaderPosition === Enums .LeaderPosition .UpperRight ) {
900- calloutFrame .x = screenx - leaderWidth / 2 - (rectWidth - leaderWidth);
907+ calloutFrame .x = screenx - leaderWidth / 2 - (calloutWidth - leaderWidth);
901908 calloutFrame .y = screeny;
902909 if (debug) {
903910 console .log (" upper right top right calloutFrame = " , calloutFrame .x , " " , calloutFrame .y );
@@ -909,14 +916,14 @@ Item {
909916 console .log (" upper left calloutFrame = " , calloutFrame .x , " " , calloutFrame .y );
910917 }
911918 } else if (adjustedLeaderPosition === Enums .LeaderPosition .LowerRight ) {
912- calloutFrame .x = screenx - rectWidth + leaderWidth / 2 ;
913- calloutFrame .y = screeny - (leaderHeight + rectHeight );
919+ calloutFrame .x = screenx - calloutWidth + leaderWidth / 2 ;
920+ calloutFrame .y = screeny - (leaderHeight + calloutHeight );
914921 if (debug) {
915922 console .log (" lower right calloutFrame = " , calloutFrame .x , " " , calloutFrame .y );
916923 }
917924 } else if (adjustedLeaderPosition === Enums .LeaderPosition .LowerLeft ) {
918925 calloutFrame .x = screenx - leaderWidth / 2 ;
919- calloutFrame .y = screeny - (leaderHeight + rectHeight );
926+ calloutFrame .y = screeny - (leaderHeight + calloutHeight );
920927 if (debug) {
921928 console .log (" lower left calloutFrame = " , calloutFrame .x , " " , calloutFrame .y );
922929 }
0 commit comments