trying to get the correct window

This commit is contained in:
Menotdan
2023-05-09 16:49:03 -04:00
parent c73ab05d70
commit 1ebf4d49e5
2 changed files with 15 additions and 5 deletions

View File

@@ -1,6 +1,7 @@
// Copyright (c) 2012-2023 Wojciech Figat. All rights reserved.
using FlaxEditor.GUI.Input;
using FlaxEditor.Windows;
using FlaxEngine;
using FlaxEngine.GUI;
using System;
@@ -212,7 +213,15 @@ namespace FlaxEditor.GUI.Dialogs
private void OnEyedropColor()
{
Editor.Log("Color: " + Screenshot.GetPixelAt(7, 6).ToString());
Float2 mousePosition = new Float2(0, 0);
foreach (EditorWindow window in Editor.Instance.Windows.Windows)
{
if (window.IsMouseOver)
{
mousePosition = window.RootWindow.MousePosition;
}
}
Editor.Log("Color: " + Screenshot.GetPixelAt(Mathf.FloorToInt(mousePosition.X), Mathf.FloorToInt(mousePosition.Y)).ToString());
}
private void OnRGBAChanged()

View File

@@ -175,9 +175,10 @@ bool GetPixelData::Run()
Array<Color32> pixels;
mipData->GetPixels(pixels, _data.Width, _data.Height, _data.Format);
_color = pixels[(y * _data.Width) + x];
LOG(Warning, "really real");
LOG(Warning, "Color: {0} {1} {2}", _color.R, _color.B, _color.G);
LOG(Warning, "{0}, {1} ({2} at {3})", x, y, pixels.Count(), (y * _data.Width) + x);
//_color = pixels[(y * _data.Width) + x];
//LOG(Warning, "really real");
//LOG(Warning, "Color: {0} {1} {2}", _color.R, _color.B, _color.G);
return false;
}