Skip to content

Commit

Permalink
remove previous implementation
Browse files Browse the repository at this point in the history
  • Loading branch information
Rdornier committed Oct 1, 2024
1 parent d9275f6 commit 4980961
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 73 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,5 @@ dist
omero_figure.egg-info
omero_figure/templates/
omero_figure/static/
.idea
.vscode
44 changes: 0 additions & 44 deletions .idea/workspace.xml

This file was deleted.

24 changes: 3 additions & 21 deletions src/js/models/panel_model.js
Original file line number Diff line number Diff line change
Expand Up @@ -730,14 +730,10 @@
var rotation = coords.rotation || 0;
// if the rectangle/viewport is rotated clockwise, the image within the
// viewport is rotated anti-clockwise
var panelRotationAngle = coords.panelRotationAngle || 0;
if (!isNaN(rotation)) {
rotation = -(rotation - 360);
toSet.rotation = rotation;
}
if (!isNaN(panelRotationAngle)) {
toSet.panelRotationAngle = panelRotationAngle;
}
this.save(toSet);
},

Expand All @@ -746,8 +742,6 @@
zoom = zoom !== undefined ? zoom : this.get('zoom');
dx = dx !== undefined ? dx : this.get('dx');
dy = dy !== undefined ? dy : this.get('dy');
// dx = this.get('is90degRotated',0) ? -dy : dx;
// dy = this.get('is90degRotated',0) ? dx : dy;
var rotation = this.get('rotation');
if (isNaN(rotation)) {
rotation = 0;
Expand All @@ -761,9 +755,6 @@
orig_width = this.get('orig_width'),
orig_height = this.get('orig_height');

// orig_width = this.get('is90degRotated',0) ? orig_height: orig_width,
// orig_height = this.get('is90degRotated',0) ? orig_width : orig_height;

// find if scaling is limited by width OR height
var xPercent = width / orig_width,
yPercent = height / orig_height,
Expand All @@ -789,9 +780,7 @@
cY = orig_height/2 - dy,
roiX = cX - (roiW / 2),
roiY = cY - (roiH / 2);
// console.log("view port as rectangle")
// console.log({'x': roiX, 'y': roiY, 'width': roiW,
// 'height': roiH, 'rotation': rotation})

return {'x': roiX, 'y': roiY, 'width': roiW,
'height': roiH, 'rotation': rotation};
},
Expand Down Expand Up @@ -986,14 +975,9 @@

var dx = x;
var dy = y;
// console.log("frame_w "+frame_w)
// console.log("frame_h "+frame_h)

var orig_w = this.get('orig_width'),
orig_h = this.get('orig_height');
//orig_w = this.get('is90degRotated',0) ? orig_h : orig_w;
// orig_h = this.get('is90degRotated',0) ? orig_w : orig_h;
// console.log("orig_w"+orig_w)
// console.log("orig_h"+orig_h)
if (typeof dx == 'undefined') dx = this.get('dx');
if (typeof dy == 'undefined') dy = this.get('dy');
zoom = zoom || 100;
Expand All @@ -1004,8 +988,6 @@
img_h = frame_h * (zoom/100),
orig_ratio = orig_w / orig_h,
vp_ratio = frame_w / frame_h;
// console.log("Math.abs(orig_ratio - vp_ratio) "+Math.abs(orig_ratio - vp_ratio))
// console.log("vp_ratio) "+vp_ratio)
if (Math.abs(orig_ratio - vp_ratio) < 0.01) {
// ignore...
// if viewport is wider than orig, offset y
Expand All @@ -1027,7 +1009,7 @@
dy = dy * (zoom/100);
img_x = (dx * vp_scale) - img_x;
img_y = (dy * vp_scale) - img_y;
// console.log(this._viewport_css(img_x, img_y, img_w, img_h, frame_w, frame_h))

return this._viewport_css(img_x, img_y, img_w, img_h, frame_w, frame_h);
},

Expand Down
6 changes: 0 additions & 6 deletions src/js/views/panel_view.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@
'change:channels change:zoom change:dx change:dy change:width change:height change:rotation change:labels change:theT change:deltaT change:theZ change:deltaZ change:z_projection change:z_start change:z_end',
this.render_labels);
this.listenTo(this.model, 'change:shapes', this.render_shapes);
this.listenTo(this.model, 'change:panelRotationAngle', this.render_panel);

// During drag or resize, model isn't updated, but we trigger 'drag'
this.model.on('drag_resize', this.drag_resize, this);
Expand Down Expand Up @@ -134,11 +133,6 @@
}
},

render_panel: function(){
var panelRotationAngle = this.model.get('panelRotationAngle')

},

render_shapes: function() {
var shapes = this.model.get('shapes'),
w = this.model.get('orig_width'),
Expand Down
3 changes: 1 addition & 2 deletions src/js/views/right_panel_view.js
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@
this.ctv.remove();
}
if (selected.length > 0) {
this.ctv = new ImageDisplayOptionsView({models: selected, figureModel: this.model});
this.ctv = new ImageDisplayOptionsView({models: selected});
$("#channelToggle").empty().append(this.ctv.render().el);
}
if (this.csv) {
Expand Down Expand Up @@ -1197,7 +1197,6 @@
initialize: function(opts) {
// This View may apply to a single PanelModel or a list
this.models = opts.models;
this.figureModel = opts.figureModel;
var self = this;
this.models.forEach(function(m){
self.listenTo(m, 'change:channels change:z_projection', self.render);
Expand Down

0 comments on commit 4980961

Please sign in to comment.