Trace:
Differences
This shows you the differences between two versions of the page.
| Both sides previous revision Previous revision | |||
|
csharp:zoom [2022/12/06 04:39] superuser |
csharp:zoom [2022/12/06 04:41] (current) superuser |
||
|---|---|---|---|
| Line 1: | Line 1: | ||
| # С использованием матриц | # С использованием матриц | ||
| <code:csharp> | <code:csharp> | ||
| - | TransformationMatrix *= Matrix.CreateTranslation(-_lastMousePosition.X, -_lastMousePosition.Y, 0); | + | TransformationMatrix = TransformationMatrix |
| - | if (e.Delta > 0) | + | * Matrix.CreateTranslation(-_lastMousePosition.X, -_lastMousePosition.Y, 0) |
| - | { | + | * Matrix.CreateScale((e.Delta > 0) ? 0.9f : (1f / 0.9f)) |
| - | TransformationMatrix *= Matrix.CreateScale(0.9f); | + | * Matrix.CreateTranslation(_lastMousePosition.X, _lastMousePosition.Y, 0); |
| - | } | + | |
| - | else | + | |
| - | { | + | |
| - | TransformationMatrix *= Matrix.CreateScale(1f/0.9f); | + | |
| - | } | + | |
| - | TransformationMatrix *= Matrix.CreateTranslation(_lastMousePosition.X, _lastMousePosition.Y, 0); | + | |
| </code> | </code> | ||
| ---- | ---- | ||
