From eafd322058c40085b980b97d401a7eddce8bd032 Mon Sep 17 00:00:00 2001 From: Mirek Fidler Date: Thu, 4 Sep 2025 16:26:42 +0200 Subject: [PATCH] ide: JSON view now shows array size --- uppsrc/RichEdit/DiagramMouse.cpp | 7 +------ uppsrc/ide/Designers/Json.cpp | 11 ++++++----- 2 files changed, 7 insertions(+), 11 deletions(-) diff --git a/uppsrc/RichEdit/DiagramMouse.cpp b/uppsrc/RichEdit/DiagramMouse.cpp index e4acc1432..82c678f5b 100644 --- a/uppsrc/RichEdit/DiagramMouse.cpp +++ b/uppsrc/RichEdit/DiagramMouse.cpp @@ -345,13 +345,8 @@ void DiagramEditor::MouseMove(Point p, dword keyflags) } else { bool rotated = m.rotate; - if(rotated) { - DLOG("======"); - DDUMP(p); + if(rotated) p = m.Rotation(-1).Transform(Pointf(p) - drag_cp) + drag_cp; - DDUMP(p); - DDUMP(r); - } Do(draghandle.x, r.left, r.right, p.x); Do(draghandle.y, r.top, r.bottom, p.y); if(m.aspect_ratio && 0) { diff --git a/uppsrc/ide/Designers/Json.cpp b/uppsrc/ide/Designers/Json.cpp index 524c97df2..a814b77e6 100644 --- a/uppsrc/ide/Designers/Json.cpp +++ b/uppsrc/ide/Designers/Json.cpp @@ -36,18 +36,19 @@ int sAddNode(TreeCtrl& tree, int parent_id, const Value& id, const String& name, else if(v.Is()) { ValueMap m = v; - parent_id = tree.Add(parent_id, IdeCommonImg::JsonStruct(), id, "[G1 [* " + name); + parent_id = tree.Add(parent_id, IdeCommonImg::JsonStruct(), id, "[G1 [* " + name + ':'); for(int i = 0; i < m.GetCount(); i++) - sAddNode(tree, parent_id, m.GetKey(i), "[@B \1" + String(m.GetKey(i)) + "\1:]", m.GetValue(i)); + sAddNode(tree, parent_id, m.GetKey(i), "[@B \1" + String(m.GetKey(i)) + "\1]", m.GetValue(i)); } else if(v.Is()) { - parent_id = tree.Add(parent_id, IdeCommonImg::JsonArray(), id, "[G1 [* " + name); + parent_id = tree.Add(parent_id, IdeCommonImg::JsonArray(), id, + "[G1 [* " + name + "]\1[" + AsString(v.GetCount()) + "]:\1"); for(int i = 0; i < v.GetCount(); i++) - sAddNode(tree, parent_id, i, "[@c " + AsString(i) + ":]", v[i]); + sAddNode(tree, parent_id, i, "[@c " + AsString(i) + "]", v[i]); } else { - String qtf = "[G1 [* " + name + "]"; + String qtf = "[G1 [* " + name + ":]"; Image img = IdeCommonImg::JsonNumber(); if(IsString(v)) { img = IdeCommonImg::JsonString();