Skip to content

Commit

Permalink
Fix for focus point
Browse files Browse the repository at this point in the history
  • Loading branch information
Rambalac committed Apr 5, 2017
1 parent ada9fce commit a7eb9b6
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 26 deletions.
4 changes: 2 additions & 2 deletions GMaster/Camera/OffframeProcessor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -194,8 +194,8 @@ private static string FindClosest(IReadOnlyDictionary<int, string> dict, int val

private static FocusPoint GetPointZoom(Slice slice)
{
var t = slice[45];
if (t == 0x41 || t == 0x01)
var t = slice[47];
if (t > 0)
{
return new FocusPoint
{
Expand Down
48 changes: 24 additions & 24 deletions GMaster/Views/CameraViewControl.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -224,30 +224,30 @@ private void RecalulateFocusPoint()
var fp = Model.FocusPoint;

double x1 = fp.X1, x2 = fp.X2, y1 = fp.Y1, y2 = fp.Y2;
if (!fp.Fixed)
{
var shiftX = 0f;
var shiftY = 0f;
switch (bitmap.SizeInPixels.Width * 10 / bitmap.SizeInPixels.Height)
{
case 17:
shiftY = 0.125f;
break;

case 15:
shiftY = 0.058f;
break;

case 10:
shiftX = 0.125f;
break;
}

x1 = (x1 - shiftX) / (1 - (2 * shiftX));
x2 = (x2 - shiftX) / (1 - (2 * shiftX));
y1 = (y1 - shiftY) / (1 - (2 * shiftY));
y2 = (y2 - shiftY) / (1 - (2 * shiftY));
}
//if (!fp.Fixed)
//{
// var shiftX = 0f;
// var shiftY = 0f;
// switch (bitmap.SizeInPixels.Width * 10 / bitmap.SizeInPixels.Height)
// {
// case 17:
// shiftY = 0.125f;
// break;

// case 15:
// shiftY = 0.058f;
// break;

// case 10:
// shiftX = 0.125f;
// break;
// }

// x1 = (x1 - shiftX) / (1 - (2 * shiftX));
// x2 = (x2 - shiftX) / (1 - (2 * shiftX));
// y1 = (y1 - shiftY) / (1 - (2 * shiftY));
// y2 = (y2 - shiftY) / (1 - (2 * shiftY));
//}

x1 = x1 * imageRect.Width;
x2 = x2 * imageRect.Width;
Expand Down

0 comments on commit a7eb9b6

Please sign in to comment.