]> sigrok.org Git - pulseview.git/blobdiff - pv/view/ruler.cpp
TraceView: Center traces vertically after view creation
[pulseview.git] / pv / view / ruler.cpp
index 31ec121d074aa724bd4a67b83c2c4272d233099c..be715ec104385576b3c66042325e51ddc14d982a 100644 (file)
@@ -14,8 +14,7 @@
  * GNU General Public License for more details.
  *
  * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA
+ * along with this program; if not, see <http://www.gnu.org/licenses/>.
  */
 
 #include <extdef.h>
@@ -33,7 +32,8 @@ using std::shared_ptr;
 using std::vector;
 
 namespace pv {
-namespace view {
+namespace views {
+namespace TraceView {
 
 const float Ruler::RulerHeight = 2.5f; // x Text Height
 const int Ruler::MinorTickSubdivision = 4;
@@ -225,9 +225,9 @@ Ruler::TickPositions Ruler::calculate_tick_positions(
        return tp;
 }
 
-void Ruler::mouseDoubleClickEvent(QMouseEvent *e)
+void Ruler::mouseDoubleClickEvent(QMouseEvent *event)
 {
-       view_.add_flag(view_.offset() + ((double)e->x() + 0.5) * view_.scale());
+       view_.add_flag(view_.offset() + ((double)event->x() + 0.5) * view_.scale());
 }
 
 void Ruler::draw_hover_mark(QPainter &p, int text_height)
@@ -271,5 +271,6 @@ void Ruler::resizeEvent(QResizeEvent*)
        invalidate_tick_position_cache();
 }
 
-} // namespace view
+} // namespace TraceView
+} // namespace views
 } // namespace pv