Skip to content

Commit 75c7797

Browse files
authored
Add missing OffsetX and OffsetY events to MouseEventArgs. (#20478)
* Add missing OffsetX and OffsetY events to MouseEventArgs. * Update public interfaces * Generate Reference Assemblies
1 parent 6bd9b2f commit 75c7797

6 files changed

+21
-3
lines changed

src/Components/Web.JS/dist/Release/blazor.server.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/Components/Web.JS/dist/Release/blazor.webassembly.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/Components/Web.JS/src/Rendering/EventForDotNet.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -201,6 +201,8 @@ function parseMouseEvent(event: MouseEvent) {
201201
screenY: event.screenY,
202202
clientX: event.clientX,
203203
clientY: event.clientY,
204+
offsetX: event.offsetX,
205+
offsetY: event.offsetY,
204206
button: event.button,
205207
buttons: event.buttons,
206208
ctrlKey: event.ctrlKey,
@@ -317,6 +319,8 @@ interface UIMouseEventArgs extends UIEventArgs {
317319
screenY: number;
318320
clientX: number;
319321
clientY: number;
322+
offsetX: number;
323+
offsetY: number;
320324
button: number;
321325
buttons: number;
322326
ctrlKey: boolean;

src/Components/Web/ref/Microsoft.AspNetCore.Components.Web.netcoreapp.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -347,6 +347,8 @@ public MouseEventArgs() { }
347347
public bool CtrlKey { [System.Runtime.CompilerServices.CompilerGeneratedAttribute] get { throw null; } [System.Runtime.CompilerServices.CompilerGeneratedAttribute] set { } }
348348
public long Detail { [System.Runtime.CompilerServices.CompilerGeneratedAttribute] get { throw null; } [System.Runtime.CompilerServices.CompilerGeneratedAttribute] set { } }
349349
public bool MetaKey { [System.Runtime.CompilerServices.CompilerGeneratedAttribute] get { throw null; } [System.Runtime.CompilerServices.CompilerGeneratedAttribute] set { } }
350+
public double OffsetX { [System.Runtime.CompilerServices.CompilerGeneratedAttribute] get { throw null; } [System.Runtime.CompilerServices.CompilerGeneratedAttribute] set { } }
351+
public double OffsetY { [System.Runtime.CompilerServices.CompilerGeneratedAttribute] get { throw null; } [System.Runtime.CompilerServices.CompilerGeneratedAttribute] set { } }
350352
public double ScreenX { [System.Runtime.CompilerServices.CompilerGeneratedAttribute] get { throw null; } [System.Runtime.CompilerServices.CompilerGeneratedAttribute] set { } }
351353
public double ScreenY { [System.Runtime.CompilerServices.CompilerGeneratedAttribute] get { throw null; } [System.Runtime.CompilerServices.CompilerGeneratedAttribute] set { } }
352354
public bool ShiftKey { [System.Runtime.CompilerServices.CompilerGeneratedAttribute] get { throw null; } [System.Runtime.CompilerServices.CompilerGeneratedAttribute] set { } }

src/Components/Web/ref/Microsoft.AspNetCore.Components.Web.netstandard2.0.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -347,6 +347,8 @@ public MouseEventArgs() { }
347347
public bool CtrlKey { [System.Runtime.CompilerServices.CompilerGeneratedAttribute] get { throw null; } [System.Runtime.CompilerServices.CompilerGeneratedAttribute] set { } }
348348
public long Detail { [System.Runtime.CompilerServices.CompilerGeneratedAttribute] get { throw null; } [System.Runtime.CompilerServices.CompilerGeneratedAttribute] set { } }
349349
public bool MetaKey { [System.Runtime.CompilerServices.CompilerGeneratedAttribute] get { throw null; } [System.Runtime.CompilerServices.CompilerGeneratedAttribute] set { } }
350+
public double OffsetX { [System.Runtime.CompilerServices.CompilerGeneratedAttribute] get { throw null; } [System.Runtime.CompilerServices.CompilerGeneratedAttribute] set { } }
351+
public double OffsetY { [System.Runtime.CompilerServices.CompilerGeneratedAttribute] get { throw null; } [System.Runtime.CompilerServices.CompilerGeneratedAttribute] set { } }
350352
public double ScreenX { [System.Runtime.CompilerServices.CompilerGeneratedAttribute] get { throw null; } [System.Runtime.CompilerServices.CompilerGeneratedAttribute] set { } }
351353
public double ScreenY { [System.Runtime.CompilerServices.CompilerGeneratedAttribute] get { throw null; } [System.Runtime.CompilerServices.CompilerGeneratedAttribute] set { } }
352354
public bool ShiftKey { [System.Runtime.CompilerServices.CompilerGeneratedAttribute] get { throw null; } [System.Runtime.CompilerServices.CompilerGeneratedAttribute] set { } }

src/Components/Web/src/Web/MouseEventArgs.cs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,16 @@ public class MouseEventArgs : EventArgs
3535
/// </summary>
3636
public double ClientY { get; set; }
3737

38+
/// <summary>
39+
/// The X coordinate of the mouse pointer in relative (Target Element) coordinates.
40+
/// </summary>
41+
public double OffsetX { get; set; }
42+
43+
/// <summary>
44+
/// The Y coordinate of the mouse pointer in relative (Target Element) coordinates.
45+
/// </summary>
46+
public double OffsetY { get; set; }
47+
3848
/// <summary>
3949
/// The button number that was pressed when the mouse event was fired:
4050
/// Left button=0,

0 commit comments

Comments
 (0)