4848#include " MRViewer/MRLambdaRibbonItem.h"
4949#include " MRIOExtras/MRPng.h"
5050#include " MRViewer/MRRibbonFontHolder.h"
51+ #include " MRViewer/MRImGuiMultiViewport.h"
5152
5253#ifndef MESHSDK_NO_VOXELS
5354#include " MRVoxels/MRObjectVoxels.h"
@@ -333,11 +334,10 @@ void OpenFilesMenuItem::preDraw_()
333334
334335 auto mainColor = ColorTheme::getRibbonColor ( ColorTheme::RibbonColorsType::BackgroundSecStyle );
335336 auto secondColor = ColorTheme::getRibbonColor ( ColorTheme::RibbonColorsType::Background );
336-
337- ImVec2 min = ImVec2 ( 10 .0f * UI::scale (), 10 .0f * UI::scale () );
338- ImVec2 max = ImVec2 ( Vector2f ( getViewerInstance ().framebufferSize ) );
339- max.x -= min.x ;
340- max.y -= min.y ;
337+
338+ ImVec2 offset = ImVec2 ( 10 .0f , 10 .0f ) * UI::scale ();
339+ ImVec2 min = ImGuiMV::Window2ScreenSpaceImVec2 ( offset );
340+ ImVec2 max = ImGuiMV::Window2ScreenSpaceImVec2 ( ImVec2 ( Vector2f ( getViewerInstance ().framebufferSize ) ) - offset );
341341 drawList->AddRectFilled ( min, max,
342342 ( addAreaHovered ? secondColor : mainColor ).scaledAlpha ( 0 .8f ).getUInt32 (), 10 .0f * UI::scale () );
343343 drawList->AddRect ( min, max, ColorTheme::getRibbonColor ( ColorTheme::RibbonColorsType::Borders ).getUInt32 (), 10 .0f * UI::scale (), 0 , 2 .0f * UI::scale () );
@@ -352,7 +352,7 @@ void OpenFilesMenuItem::preDraw_()
352352 {
353353 auto sceneBoxSize = menu->getSceneSize ();
354354 min.y += ( getViewerInstance ().framebufferSize .y - sceneBoxSize.y );
355- max.x = sceneBoxSize.x - min. x ;
355+ max.x = min. x + sceneBoxSize.x - offset. x * 2 . f ;
356356 drawList->AddRectFilled ( min, max, ( addAreaHovered ? mainColor : secondColor ).scaledAlpha ( 0 .8f ).getUInt32 (), 10 .0f * UI::scale () );
357357 drawList->AddRect ( min, max, ColorTheme::getRibbonColor ( ColorTheme::RibbonColorsType::Borders ).getUInt32 (), 10 .0f * UI::scale (), 0 , 2 .0f * UI::scale () );
358358
0 commit comments