diff --git a/src/wp-includes/js/tinymce/plugins/wpeditimage/plugin.js b/src/wp-includes/js/tinymce/plugins/wpeditimage/plugin.js index 3b1667d425..d8b735fb9d 100644 --- a/src/wp-includes/js/tinymce/plugins/wpeditimage/plugin.js +++ b/src/wp-includes/js/tinymce/plugins/wpeditimage/plugin.js @@ -238,7 +238,9 @@ tinymce.PluginManager.add( 'wpeditimage', function( editor ) { left = boundaryMiddle - toolbarHalf; left += iframePos.x; - if ( toolbarWidth >= windowWidth ) { + if ( boundary.left < 0 || boundary.right > iframeWidth ) { + left = iframePos.x + ( iframeWidth - toolbarWidth ) / 2; + } else if ( toolbarWidth >= windowWidth ) { className += ' mce-arrow-full'; left = 0; } else if ( ( left < 0 && boundary.left + toolbarWidth > windowWidth ) ||