Skip to content

Commit 6bd3ea4

Browse files
committed
Fix DFL-3567: Overlay shown on hovering paint events positioned incorrectly when page is scrolled.
1 parent 9101f78 commit 6bd3ea4

File tree

3 files changed

+12
-2
lines changed

3 files changed

+12
-2
lines changed

src/profiler/profiler.1.0.responses.getevents.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -252,6 +252,8 @@ cls.Profiler["1.0"].Area = function(arr, parent)
252252
this.y = arr[1];
253253
this.w = arr[2];
254254
this.h = arr[3];
255+
this.ox = arr[4];
256+
this.oy = arr[5];
255257
this.toString = function() { return "[message Area]"; }
256258
};
257259

src/profiler/profiler_templates.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -480,7 +480,10 @@ var ProfilerTemplates = function()
480480
ui_strings.S_PROFILER_AREA_LOCATION + ": ",
481481
"class", "profiler-event-tooltip-label"
482482
],
483-
"(" + area.x + ", " + area.y + ")"
483+
(window.services["profiler"].satisfies_version(1, 1)
484+
? "(" + (area.x + area.ox) + ", " + (area.y + area.oy) + ")"
485+
: "(" + area.x + ", " + area.y + ")"
486+
)
484487
],
485488
["li",
486489
["span",

src/profiler/profiler_view.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -423,7 +423,12 @@ var ProfilerView = function(id, name, container_class, html, default_handler)
423423
if (timeline_event.type === TYPE_PAINT)
424424
{
425425
var area = timeline_event.paint.area;
426-
var config = {x: area.x, y: area.y, w: area.w, h:area.h};
426+
var config = {x: area.x, y: area.y, w: area.w, h: area.h};
427+
if (window.services["profiler"].satisfies_version(1, 1))
428+
{
429+
config.x += area.ox;
430+
config.y += area.oy;
431+
}
427432
this._overlay.create_overlay(null, config);
428433
}
429434
}

0 commit comments

Comments
 (0)