Bug 1837 - Math channel is not drawn at the correct height, overlapping another trace
Summary: Math channel is not drawn at the correct height, overlapping another trace
Status: CONFIRMED
Alias: None
Product: PulseView
Classification: Unclassified
Component: UI (show other bugs)
Version: unreleased development snapshot
Hardware: All All
: Normal normal
Target Milestone: ---
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-04-15 13:16 CEST by cedric
Modified: 2023-04-15 13:16 CEST (History)
0 users



Attachments
Screenshot, Math1 trace overlaps A3 trace (77.56 KB, image/png)
2023-04-15 13:16 CEST, cedric
Details

Note You need to log in before you can comment on or make changes to this bug.
Description cedric 2023-04-15 13:16:00 CEST
Created attachment 793 [details]
Screenshot, Math1 trace overlaps A3 trace

Overview: The math channel is not drawn at the correct height, this causes the math trace to overlap another trace.

Steps to Reproduce:
1) Start Pulseview
2) Remove all traces of the demo device, except A3 (sawtooth)
3) Set the number of samples to 100, and set the samplerate to 100Hz
4) Click Run. Now channel A3 draws a sawtooth
5) Click "Add math channel". the signal trace "Math1" appears. This trace is drawn correctly, and does not overlap the A3 trace.
6) Click "Math1", and then the 4 symbols at the end of the line "expression". Now the "Math Expression Editor" appears.
7) Enter the following expression and click OK.
var themax := 0;
var thesample := A3;

if (thesample > themax)
{
	themax := thesample;
}

Actual Results:
The Math1 trace jumps up, and overlaps the A3 trace. (see the screenshot)

Expected Results:
the A3 and Math1 traces should be drawn under each other, so the traces don't overlap

Build Date & Hardware: I build it myself on 04/15/2023 on a 64 bit AMD machine.
PulseView 0.5.0-git-62c0968
libsigrok 0.6.0-git/4:0:0 (rt: 0.6.0-git-5bce22ac/4:0:0)
Kernel version: $ uname -a 
Linux cedric 6.2.11-arch1-1 #1 SMP PREEMPT_DYNAMIC Thu, 13 Apr 2023 16:59:24 +0000 x86_64 GNU/Linux

Additional Builds and Platforms: Also seen with Windows 10 and this version:
https://www.dropbox.com/s/i1guje5kg89yi7a/pulseview-0.5.0-git-7e5c839-installer_rev2.exe?dl=0

Additional Information:
When both traces are dragged, they move together, still overlapping. When the mouse is released, the traces are drawn correctly. When they are then drawn again, they correctly move together again.