trying to get the correct window
This commit is contained in:
@@ -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()
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user