개정판 a69467b1
Upgrade a method rotate shape
KCOM/Controls/AdornerFinal.xaml.cs | ||
---|---|---|
48 | 48 |
public Thumb mainDragThumb { get; set; } |
49 | 49 |
|
50 | 50 |
public Point reSizePoint { get; set; } |
51 |
private Point rotatePoint { get; set; } /// 2018.05.09 added by humkyung |
|
51 | 52 |
#endregion |
52 | 53 |
#region 생성자 |
53 | 54 |
private void RadDropDownButton_Loaded(object sender, RoutedEventArgs e) |
... | ... | |
2143 | 2144 |
double SetWidth = 0; |
2144 | 2145 |
bool RotateFlag = false; |
2145 | 2146 |
|
2147 |
/// <summary> |
|
2148 |
/// <history>humkyung 2018.05.09 upgrade rotate shape peformance</history> |
|
2149 |
/// </summary> |
|
2150 |
/// <param name="e"></param> |
|
2146 | 2151 |
public void MoveRotate(DragDeltaEventArgs e) |
2147 | 2152 |
{ |
2148 | 2153 |
double dDeltaAngle = 0; |
... | ... | |
2195 | 2200 |
|
2196 | 2201 |
//강인구 수정 |
2197 | 2202 |
AngleValue = AngleValue + dDeltaAngle; |
2203 |
#endregion |
|
2198 | 2204 |
|
2199 |
if ((MemberSet.First() as AdornerMember).DrawingData.GetType().Name != "TextControl") |
|
2205 |
#region 센터 포인트 구하기 (그룹핑) |
|
2206 |
foreach (var item in MemberSet) |
|
2200 | 2207 |
{ |
2201 |
SetWidth = (((e.Source as Thumb).Parent as Grid).Width - LastWidthValue) / 2; |
|
2202 |
|
|
2203 |
|
|
2204 |
//System.Diagnostics.Debug.WriteLine("Width" + ((e.Source as Thumb).Parent as Grid).Width); |
|
2205 |
//System.Diagnostics.Debug.WriteLine("e.HorizontalChange : " + e.HorizontalChange); |
|
2206 |
//System.Diagnostics.Debug.WriteLine("e.VerticalChange : " + e.VerticalChange); |
|
2207 |
//System.Diagnostics.Debug.WriteLine(""); |
|
2208 |
|
|
2209 |
//((e.Source as Thumb).Parent as Grid).Width |
|
2210 |
|
|
2211 |
if (Math.Abs(e.HorizontalChange) > Math.Abs(e.VerticalChange)) |
|
2208 |
if (item.DrawingData.GetType().Name == "TextControl") |
|
2212 | 2209 |
{ |
2213 |
//System.Diagnostics.Debug.WriteLine("e.HorizontalChange : " + e.HorizontalChange); |
|
2214 |
//System.Diagnostics.Debug.WriteLine("e.VerticalChange : " + e.VerticalChange); |
|
2215 |
|
|
2216 |
//if (LastRotateHorizontalValue < e.HorizontalChange) |
|
2217 |
//if (LastRotateHorizontalValue < e.HorizontalChange + SetWidth) |
|
2218 |
//if (LastRotateHorizontalValue + LastRotateVerticalValue < e.HorizontalChange + e.VerticalChange) |
|
2219 |
if(RotateFlag) |
|
2220 |
{ |
|
2221 |
dDeltaAngle = 5; |
|
2222 |
AngleValue = AngleValue + dDeltaAngle; |
|
2223 |
} |
|
2224 |
else |
|
2210 |
} |
|
2211 |
else |
|
2212 |
{ |
|
2213 |
foreach (Point itemP in (item.DrawingData as IPath).PointSet) |
|
2225 | 2214 |
{ |
2226 |
dDeltaAngle = -5; |
|
2227 |
AngleValue = AngleValue + dDeltaAngle; |
|
2215 |
AllPointSet.Add(itemP); |
|
2228 | 2216 |
} |
2229 | 2217 |
} |
2230 | 2218 |
} |
2219 |
#endregion |
|
2220 |
CenterPoint = MathSet.FindCentroid(AllPointSet); |
|
2221 |
Point pt = Mouse.GetPosition(this); |
|
2222 |
|
|
2223 |
if ((MemberSet.First() as AdornerMember).DrawingData.GetType().Name != "TextControl") |
|
2224 |
{ |
|
2225 |
Point vec1 = new Point(this.rotatePoint.X - CenterPoint.X, this.rotatePoint.Y - CenterPoint.Y); |
|
2226 |
Point vec2 = new Point(pt.X - CenterPoint.X, pt.Y - CenterPoint.Y); |
|
2227 |
dDeltaAngle = (MathSet.getAngleBetweenVectors(vec1, vec2)); |
|
2228 |
} |
|
2231 | 2229 |
else |
2232 | 2230 |
{ |
2233 | 2231 |
if (IsTextAngle || RotateFlag) |
2234 | 2232 |
{ |
2235 | 2233 |
AngleValue = ((MemberSet.First() as AdornerMember).DrawingData as TextControl).Angle + 5; |
2236 |
//AngleValue = AngleValue + 2; |
|
2237 | 2234 |
} |
2238 | 2235 |
else |
2239 | 2236 |
{ |
2240 | 2237 |
AngleValue = ((MemberSet.First() as AdornerMember).DrawingData as TextControl).Angle - 5; |
2241 |
//AngleValue = AngleValue - 2; |
|
2242 | 2238 |
} |
2243 | 2239 |
} |
2244 | 2240 |
|
2245 |
//LastRotateHorizontalValue = e.HorizontalChange; |
|
2246 |
//LastRotateVerticalValue = e.VerticalChange; |
|
2247 |
//LastWidthValue = ((e.Source as Thumb).Parent as Grid).Width; |
|
2248 |
|
|
2249 |
//Set_Rotate(); |
|
2250 |
|
|
2251 |
if (AngleValue >= 360) |
|
2252 |
{ |
|
2253 |
AngleValue -= 360; |
|
2254 |
dDeltaAngle -= 360; |
|
2255 |
} |
|
2256 |
else if (AngleValue <= -360) |
|
2257 |
{ |
|
2258 |
AngleValue += 360; |
|
2259 |
dDeltaAngle += 360; |
|
2260 |
} |
|
2261 |
#endregion |
|
2262 |
|
|
2263 |
#region 센터 포인트 구하기 (그룹핑) |
|
2264 |
foreach (var item in MemberSet) |
|
2265 |
{ |
|
2266 |
if (item.DrawingData.GetType().Name == "TextControl") |
|
2267 |
{ |
|
2268 |
} |
|
2269 |
else |
|
2270 |
{ |
|
2271 |
foreach (Point itemP in (item.DrawingData as IPath).PointSet) |
|
2272 |
{ |
|
2273 |
AllPointSet.Add(itemP); |
|
2274 |
} |
|
2275 |
} |
|
2276 |
} |
|
2277 |
#endregion |
|
2278 |
CenterPoint = MathSet.FindCentroid(AllPointSet); |
|
2241 |
AngleValue += dDeltaAngle; |
|
2242 |
if (AngleValue > 360) AngleValue -= 360; |
|
2243 |
if (AngleValue < 0) AngleValue += 360; |
|
2244 |
this.rotatePoint = pt; /// save rotatePoint |
|
2279 | 2245 |
|
2280 | 2246 |
Dispatcher.BeginInvoke((Action)(() => |
2281 | 2247 |
{ |
... | ... | |
2528 | 2494 |
private void rotate_DragStarted(object sender, DragStartedEventArgs e) |
2529 | 2495 |
{ |
2530 | 2496 |
//System.Windows.Forms.Cursor.Position = new System.Drawing.Point(System.Windows.Forms.Cursor.Position.X - 150, System.Windows.Forms.Cursor.Position.Y - 150); |
2531 |
|
|
2497 |
this.rotatePoint = Mouse.GetPosition(this); /// 2018.05.09 added by humkyung |
|
2532 | 2498 |
rotateTop.Cursor = Cursors.SizeAll; |
2533 | 2499 |
|
2534 | 2500 |
//CustomCursor.SetCursorTemplate(rotateTop, this.Resources["AnimatedCursor"] as DataTemplate); |
KCOM/Properties/AssemblyInfo.cs | ||
---|---|---|
51 | 51 |
// 모든 값을 지정하거나 아래와 같이 '*'를 사용하여 빌드 번호 및 수정 번호가 자동으로 |
52 | 52 |
// 지정되도록 할 수 있습니다. |
53 | 53 |
// [assembly: AssemblyVersion("1.0.*")] |
54 |
[assembly: AssemblyVersion("1.0.0.0")] |
|
55 |
[assembly: AssemblyFileVersion("1.0.0.0")] |
|
54 |
[assembly: AssemblyVersion("1.5.0.0")] |
|
55 |
[assembly: AssemblyFileVersion("1.5.0.0")] |
KCOMDataModel/bin/Release/KCOMDataModel.dll.config | ||
---|---|---|
1 |
<?xml version="1.0" encoding="utf-8"?> |
|
2 |
<configuration> |
|
3 |
<configSections> |
|
4 |
<!-- For more information on Entity Framework configuration, visit http://go.microsoft.com/fwlink/?LinkID=237468 --> |
|
5 |
<section name="entityFramework" type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework, Version=4.4.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" /> |
|
6 |
<sectionGroup name="applicationSettings" type="System.Configuration.ApplicationSettingsGroup, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> |
|
7 |
<section name="KCOMDataModel.Properties.Settings" type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" /> |
|
8 |
</sectionGroup> |
|
9 |
</configSections> |
|
10 |
<connectionStrings> |
|
11 |
<add name="KCOMEntities" connectionString="metadata=res://*/DataModel.KCOM_Model.csdl|res://*/DataModel.KCOM_Model.ssdl|res://*/DataModel.KCOM_Model.msl;provider=System.Data.SqlClient;provider connection string="data source=honeyhead.net,7777;initial catalog=DeepView;persist security info=True;user id=honeyhead;password=dof1073#;multipleactiveresultsets=True;application name=EntityFramework"" providerName="System.Data.EntityClient" /> |
|
12 |
<add name="CIEntities" connectionString="metadata=res://*/DataModel.CIModel.csdl|res://*/DataModel.CIModel.ssdl|res://*/DataModel.CIModel.msl;provider=System.Data.SqlClient;provider connection string="data source=honeyhead.net,7777;initial catalog=DeepView;persist security info=True;user id=honeyhead;password=dof1073#;multipleactiveresultsets=True;application name=EntityFramework"" providerName="System.Data.EntityClient" /> |
|
13 |
</connectionStrings> |
|
14 |
<entityFramework> |
|
15 |
<defaultConnectionFactory type="System.Data.Entity.Infrastructure.LocalDbConnectionFactory, EntityFramework"> |
|
16 |
<parameters> |
|
17 |
<parameter value="v13.0" /> |
|
18 |
</parameters> |
|
19 |
</defaultConnectionFactory> |
|
20 |
</entityFramework> |
|
21 |
<applicationSettings> |
|
22 |
<KCOMDataModel.Properties.Settings> |
|
23 |
<setting name="ProjectConnectionString" serializeAs="String"> |
|
24 |
<value>data source=honeyhead.net,7777;database={0};user id=honeyhead;password=dof1073#</value> |
|
25 |
</setting> |
|
26 |
</KCOMDataModel.Properties.Settings> |
|
27 |
</applicationSettings> |
|
28 |
</configuration> |
MarkupToPDF/Controls/Common/MathSet.cs | ||
---|---|---|
373 | 373 |
|
374 | 374 |
} |
375 | 375 |
|
376 |
/// <summary> |
|
377 |
/// return angle in degree between given two vectors |
|
378 |
/// </summary> |
|
379 |
/// <author>humkyung</author> |
|
380 |
/// <date>2018.05.09</date> |
|
381 |
/// <param name="vec1"></param> |
|
382 |
/// <param name="vec2"></param> |
|
383 |
/// <returns></returns> |
|
384 |
public static double getAngleBetweenVectors(Point vec1, Point vec2) |
|
385 |
{ |
|
386 |
double dot = MathSet.DotProduct(vec1.X, vec1.Y, vec2.X, vec2.Y); |
|
387 |
double length1 = Math.Sqrt(vec1.X * vec1.X + vec1.Y * vec1.Y); |
|
388 |
double length2 = Math.Sqrt(vec2.X * vec2.X + vec2.Y * vec2.Y); |
|
389 |
double cross = MathSet.CrossProduct(vec1.X, vec1.Y, vec2.X, vec2.Y); |
|
390 |
double radian = Math.Acos(dot / (length1 * length2)); |
|
391 |
|
|
392 |
return (cross > 0) ? radian * MathSet.Rad2Deg : -(radian * MathSet.Rad2Deg); |
|
393 |
} |
|
394 |
|
|
376 | 395 |
public static string returnAngleString(Point start, ref Point end, bool PressShift) |
377 | 396 |
{ |
378 | 397 |
double angle = MathSet.getAngle(start.X, start.Y, end.X, end.Y); |
MarkupToPDF/obj/x64/Debug/GeneratedInternalTypeHelper.g.cs | ||
---|---|---|
1 |
|
|
2 |
|
MarkupToPDF/obj/x64/Debug/MarkupToPDF_MarkupCompile.lref | ||
---|---|---|
1 |
d:\Projects\MarkUS\MarkupToPDF\obj\x64\Debug\GeneratedInternalTypeHelper.g.cs |
|
2 |
|
|
3 |
Fd:\Projects\MarkUS\MarkupToPDF\Controls\Custom\CustomText.xaml;; |
|
4 |
Fd:\Projects\MarkUS\MarkupToPDF\Themes\generic.xaml;; |
|
5 |
|
내보내기 Unified diff