PPK2 screenshot chopping

Hi,

Using Power Profiler v3.3.0 with PPK2 on Chrome on MacOS.

The screenshot action results in a chopped image. See the top part is missing?

When I remove (by commenting original code) the chopping code from src/actions/fileActions.js, like this:

export const screenshot = () => async () => {
    const win = remote.getCurrentWindow();
    const mainElement = document.querySelector('.core19-main-container');
    const { x, y, width, height } = mainElement.getBoundingClientRect();
    // const chartTop = mainElement.querySelector('.chart-top');
    // const { marginTop, height: h } = getComputedStyle(chartTop);
    // const chopOff = parseInt(marginTop, 10) + parseInt(h, 10);
    const image = await win.capturePage({
        x,
        // y: y + chopOff,
        y,
        width,
        height,
        // height: height - chopOff,
    });
    
    // ...
};

A screenshot looks so much better:

Looking at git blame I see the screenshot code is 'old' and never changed after it was added. Maybe this chopping code made sense in a different app, but not in the power profiler?

If you agree the chopping code can go, I'll gladly submit a pr on github.

Regards.

Related