• R/O
  • HTTP
  • SSH
  • HTTPS

Commit

Tags
No Tags

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

Commit MetaInfo

Revisãoa4a4d0b03ca44d3b4119a0908794fc6534b8f8ba (tree)
Hora2013-10-24 10:11:10
AutorHMML <hmml3939@gmai...>
CommiterHMML

Mensagem de Log

Improve marker tracking.

Mudança Sumário

Diff

Binary files a/MMM_GraphEditor.v11.suo and b/MMM_GraphEditor.v11.suo differ
--- a/MMM_GraphEditor/GraphPort.cs
+++ b/MMM_GraphEditor/GraphPort.cs
@@ -28,6 +28,7 @@ namespace MMM_GraphEditor
2828 private GraphPanel _panel_inner;
2929 private GraphPanel _panel_outer;
3030 private GraphEditorControl _main_control;
31+ public int center_marker_padding = 36;
3132
3233 protected override void OnMouseWheel(MouseEventArgs e)
3334 {
@@ -260,7 +261,18 @@ namespace MMM_GraphEditor
260261 {
261262 if (scene == null) return;
262263 if (PanelOuter == null) return;
263- PanelOuter.AutoScrollPosition = new Point((int)(scene.MarkerPosition * frame_width - PanelOuter.Width / 2), 0);
264+
265+ int cur = -PanelOuter.AutoScrollPosition.X;
266+ if (scene.MarkerPosition * frame_width - center_marker_padding < cur)
267+ {
268+ PanelOuter.AutoScrollPosition = new Point((int)(scene.MarkerPosition * frame_width - center_marker_padding), 0);
269+ return;
270+ }
271+ if (scene.MarkerPosition * frame_width + center_marker_padding > cur + PanelOuter.Width)
272+ {
273+ PanelOuter.AutoScrollPosition = new Point((int)(scene.MarkerPosition * frame_width - PanelOuter.Width + center_marker_padding), 0);
274+ return;
275+ }
264276 }
265277
266278 public void centerMarkerVirtical()