Skip to content

Commit

Permalink
#60 working on caret position
Browse files Browse the repository at this point in the history
  • Loading branch information
abbaye committed Dec 24, 2020
1 parent 94d9bd3 commit b802b23
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion Sources/WPFHexaEditor/HexByte.cs
Original file line number Diff line number Diff line change
Expand Up @@ -173,13 +173,20 @@ private void UpdateCaret()
else
{
//TODO: clear size and use BaseByte.TextFormatted property...
//TODO: Take the scale factor from parent
var size = Text[1].ToString()
.GetScreenSize(_parent.FontFamily, _parent.FontSize, _parent.FontStyle, FontWeight,
_parent.FontStretch, _parent.Foreground, this);

_parent.SetCaretSize(Width / 2, size.Height);
//update site with scale factor
//size.Width *= _parent.ZoomScale;
//size.Height *= _parent.ZoomScale;

_parent.SetCaretSize(size.Width + 2, ActualHeight - 2);
_parent.SetCaretMode(_parent.VisualCaretMode);

//TODO: DEBUG POSITION WHEN THE SCALE FACTOR IS NOT 1

switch (_keyDownLabel)
{
case KeyDownLabel.FirstChar:
Expand Down

0 comments on commit b802b23

Please sign in to comment.