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
Alias: None
Product: PulseView
Classification: Unclassified
Component: UI (show other bugs)
Version: unreleased development snapshot
Hardware: All All
: Normal normal
Target Milestone: ---
Assignee: Nobody
Depends on:
Reported: 2023-04-15 13:16 CEST by cedric
Modified: 2023-04-15 13:16 CEST (History)
0 users

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

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:

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.