Correccion errores de OCR
This commit is contained in:
parent
fe8f2119ce
commit
20bdad509b
|
@ -74,6 +74,8 @@ namespace CtrEditor
|
||||||
private Image _backgroundImage; // Add this line
|
private Image _backgroundImage; // Add this line
|
||||||
internal bool IsDraggingCanvas { get; set; }
|
internal bool IsDraggingCanvas { get; set; }
|
||||||
private bool _isRectangleSelectionActive;
|
private bool _isRectangleSelectionActive;
|
||||||
|
private bool _selectedObjectsAreVisible;
|
||||||
|
|
||||||
public bool IsRectangleSelectionActive
|
public bool IsRectangleSelectionActive
|
||||||
{
|
{
|
||||||
get => _isRectangleSelectionActive;
|
get => _isRectangleSelectionActive;
|
||||||
|
@ -185,6 +187,7 @@ namespace CtrEditor
|
||||||
|
|
||||||
// Calcular el bounding box que contenga todos los objetos seleccionados
|
// Calcular el bounding box que contenga todos los objetos seleccionados
|
||||||
Rect boundingBox = CalculateTotalBoundingBox(selectedObjects);
|
Rect boundingBox = CalculateTotalBoundingBox(selectedObjects);
|
||||||
|
if (_selectedObjectsAreVisible) {
|
||||||
|
|
||||||
FuncionesBase.MutableRect rectBox = new FuncionesBase.MutableRect(boundingBox);
|
FuncionesBase.MutableRect rectBox = new FuncionesBase.MutableRect(boundingBox);
|
||||||
rectBox.Left -= (float)rectHighlightSize;
|
rectBox.Left -= (float)rectHighlightSize;
|
||||||
|
@ -211,6 +214,7 @@ namespace CtrEditor
|
||||||
// Add resize/rotation handles
|
// Add resize/rotation handles
|
||||||
AddResizeHandles(rectBox, 10, rotationCursorRx, rotationCursorSx);
|
AddResizeHandles(rectBox, 10, rotationCursorRx, rotationCursorSx);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private Rect CalculateTotalBoundingBox(IEnumerable<osBase> selectedObjects)
|
private Rect CalculateTotalBoundingBox(IEnumerable<osBase> selectedObjects)
|
||||||
{
|
{
|
||||||
|
@ -218,10 +222,11 @@ namespace CtrEditor
|
||||||
double top = double.MaxValue;
|
double top = double.MaxValue;
|
||||||
double right = double.MinValue;
|
double right = double.MinValue;
|
||||||
double bottom = double.MinValue;
|
double bottom = double.MinValue;
|
||||||
|
_selectedObjectsAreVisible = false;
|
||||||
|
|
||||||
foreach (var obj in selectedObjects)
|
foreach (var obj in selectedObjects)
|
||||||
{
|
{
|
||||||
if (obj.VisualRepresentation != null)
|
if (obj.VisualRepresentation != null && obj.VisualRepresentation.Visibility!=Visibility.Collapsed)
|
||||||
{
|
{
|
||||||
// Obtener el bounding box del objeto actual
|
// Obtener el bounding box del objeto actual
|
||||||
Rect objectBounds = VisualTreeHelper.GetDescendantBounds(obj.VisualRepresentation);
|
Rect objectBounds = VisualTreeHelper.GetDescendantBounds(obj.VisualRepresentation);
|
||||||
|
@ -233,6 +238,7 @@ namespace CtrEditor
|
||||||
top = Math.Min(top, transformedBounds.Top);
|
top = Math.Min(top, transformedBounds.Top);
|
||||||
right = Math.Max(right, transformedBounds.Right);
|
right = Math.Max(right, transformedBounds.Right);
|
||||||
bottom = Math.Max(bottom, transformedBounds.Bottom);
|
bottom = Math.Max(bottom, transformedBounds.Bottom);
|
||||||
|
_selectedObjectsAreVisible = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -382,7 +382,10 @@ namespace CtrEditor.ObjetosSim
|
||||||
|
|
||||||
if (Angulo != 0)
|
if (Angulo != 0)
|
||||||
{
|
{
|
||||||
RotateTransform rotateTransform = new RotateTransform(-Angulo);
|
// TransformedBitmap only accepts rotations in 90-degree increments
|
||||||
|
// Round to nearest 90 degrees: 0, 90, 180, or 270
|
||||||
|
double normalizedAngle = Math.Round(Angulo / 90.0) * 90.0;
|
||||||
|
RotateTransform rotateTransform = new RotateTransform(-normalizedAngle);
|
||||||
transformedBitmap.Transform = rotateTransform;
|
transformedBitmap.Transform = rotateTransform;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -463,7 +466,10 @@ namespace CtrEditor.ObjetosSim
|
||||||
|
|
||||||
if (Angulo != 0)
|
if (Angulo != 0)
|
||||||
{
|
{
|
||||||
RotateTransform rotateTransform = new RotateTransform(-Angulo);
|
// TransformedBitmap only accepts rotations in 90-degree increments
|
||||||
|
// Round to nearest 90 degrees: 0, 90, 180, or 270
|
||||||
|
double normalizedAngle = Math.Round(Angulo / 90.0) * 90.0;
|
||||||
|
RotateTransform rotateTransform = new RotateTransform(-normalizedAngle);
|
||||||
transformedBitmap.Transform = rotateTransform;
|
transformedBitmap.Transform = rotateTransform;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue