개정판 2184f659
issue #923: fixed miss location of image when pasting
Change-Id: I10c3dc7996496e0f6fab45e966871ad631ae5452
KCOM/Events/PasteCommand.cs | ||
---|---|---|
113 | 113 |
var diff = Point.Subtract(Common.ViewerDataModel.Instance.SystemMain.dzMainMenu.getCurrentPoint, final.Centeroid); |
114 | 114 |
final.TranslateItems(diff.X, diff.Y); |
115 | 115 |
|
116 |
//if (final.Members.Where(type => type.Drawingtype == MarkupToPDF.Controls.Common.ControlType.TextControl).FirstOrDefault() != null) |
|
117 |
//{ |
|
118 |
// final.TranslateItems(0.001, 0.001); //dummy |
|
119 |
//} |
|
120 |
|
|
121 | 116 |
Common.ViewerDataModel.Instance.SystemMain.dzMainMenu.SelectLayer.Children.Add(final); |
122 | 117 |
} |
123 | 118 |
/// 외부 이미지 붙여넣기 |
... | ... | |
155 | 150 |
byte[] data = br.ReadBytes((int)numByte); |
156 | 151 |
|
157 | 152 |
filename = fileUploader.Run(App.ViewInfo.ProjectNO, Common.ViewerDataModel.Instance.SystemMain.dzMainMenu._DocItem.DOCUMENT_NO, App.ViewInfo.UserID, strFile + ".png", data); |
158 |
|
|
159 | 153 |
Check_Uri.UriCheck(filename); |
160 | 154 |
|
161 | 155 |
br.Close(); |
... | ... | |
190 | 184 |
{ |
191 | 185 |
img.Source = new BitmapImage(new Uri(filename)); |
192 | 186 |
} |
187 |
|
|
188 |
|
|
189 |
var vecSize = new Vector(clipboardImage.Width, clipboardImage.Height); |
|
190 |
var EndPoint = Point.Add(Common.ViewerDataModel.Instance.SystemMain.dzMainMenu.getCurrentPoint, vecSize); |
|
193 | 191 |
var currentControl = new MarkupToPDF.Controls.Etc.ImgControl |
194 | 192 |
{ |
195 | 193 |
PointSet = new List<Point>(), |
196 | 194 |
FilePath = filename, |
197 | 195 |
ImageData = img.Source, |
198 |
StartPoint = new Point(100, 100), |
|
199 |
EndPoint = new Point(200, 200), |
|
200 |
TopRightPoint = new Point(100, 200), |
|
201 |
LeftBottomPoint = new Point(200, 100) |
|
196 |
StartPoint = Common.ViewerDataModel.Instance.SystemMain.dzMainMenu.getCurrentPoint, |
|
197 |
EndPoint = Point.Add(Common.ViewerDataModel.Instance.SystemMain.dzMainMenu.getCurrentPoint, vecSize), |
|
198 |
TopRightPoint = new Point(Common.ViewerDataModel.Instance.SystemMain.dzMainMenu.getCurrentPoint.X + vecSize.X, |
|
199 |
Common.ViewerDataModel.Instance.SystemMain.dzMainMenu.getCurrentPoint.Y), |
|
200 |
LeftBottomPoint = new Point(Common.ViewerDataModel.Instance.SystemMain.dzMainMenu.getCurrentPoint.X, |
|
201 |
Common.ViewerDataModel.Instance.SystemMain.dzMainMenu.getCurrentPoint.Y + vecSize.Y) |
|
202 | 202 |
}; |
203 | 203 |
|
204 |
currentControl.TopRightPoint = new Point(currentControl.StartPoint.X + clipboardImage.Width, currentControl.StartPoint.Y); |
|
205 |
currentControl.LeftBottomPoint = new Point(currentControl.StartPoint.X, currentControl.StartPoint.Y + clipboardImage.Height); |
|
206 |
currentControl.EndPoint = new Point(currentControl.StartPoint.X + clipboardImage.Width, currentControl.StartPoint.Y + clipboardImage.Height); |
|
207 |
|
|
208 | 204 |
currentControl.PointSet = new List<Point> |
209 |
{
|
|
210 |
currentControl.StartPoint,
|
|
211 |
currentControl.LeftBottomPoint,
|
|
212 |
currentControl.EndPoint,
|
|
213 |
currentControl.TopRightPoint,
|
|
214 |
};
|
|
205 |
{ |
|
206 |
currentControl.StartPoint, |
|
207 |
currentControl.LeftBottomPoint, |
|
208 |
currentControl.EndPoint, |
|
209 |
currentControl.TopRightPoint, |
|
210 |
}; |
|
215 | 211 |
|
216 | 212 |
multi_Undo_Data = Common.ViewerDataModel.Instance.SystemMain.dzMainMenu.Control_Style(currentControl as MarkupToPDF.Common.CommentUserInfo); |
217 | 213 |
UndoData.Markup_List.Add(multi_Undo_Data); |
... | ... | |
226 | 222 |
ViewerDataModel.Instance.MarkupControls_USER.Remove(currentControl as MarkupToPDF.Common.CommentUserInfo); |
227 | 223 |
Controls.AdornerFinal final = new Controls.AdornerFinal(currentControl as MarkupToPDF.Common.CommentUserInfo); |
228 | 224 |
Common.ViewerDataModel.Instance.SystemMain.dzMainMenu.SelectLayer.Children.Add(final); |
229 |
|
|
230 |
double realPointX = Common.ViewerDataModel.Instance.SystemMain.dzMainMenu.getCurrentPoint.X - final.BorderSize.X - (final.BorderSize.Width / 2); |
|
231 |
double realPointY = Common.ViewerDataModel.Instance.SystemMain.dzMainMenu.getCurrentPoint.Y - final.BorderSize.Y - (final.BorderSize.Height / 2); |
|
232 |
final.TranslateItems(realPointX, realPointY); |
|
233 | 225 |
} |
234 | 226 |
catch (Exception ex) |
235 | 227 |
{ |
내보내기 Unified diff