Skip to content

Commit

Permalink
Merge pull request #1074 from camicroscope/fix-port-xml
Browse files Browse the repository at this point in the history
Default color/style
  • Loading branch information
birm authored Jan 15, 2025
2 parents 3dc7b36 + 2afcd52 commit e48dffb
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
7 changes: 5 additions & 2 deletions common/DrawHelper.js
Original file line number Diff line number Diff line change
Expand Up @@ -192,9 +192,12 @@ caDrawHelper.prototype.draw = function(ctx, image_data){
for (let i = 0; i < image_data.length; i++) {
const polygon = image_data[i];
if (polygon.properties == undefined || polygon.properties == null){
polygon.properties = {}
polygon.properties = {};
}
let style = polygon.properties.style;
if (style == undefined || style == null){
style = {"color":"#FF6926"};
}
const style = polygon.properties.style;

// if there is path using path to draw
// if(polygon.geometry.path){
Expand Down
7 changes: 5 additions & 2 deletions core/extension/openseadragon-overlays-manage.js
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,10 @@
if($.isArray(layer.data)){
for(let j = 0;j < layer.data.length;j++){
const path = layer.data[j].geometry.path;
const style = layer.data[j].properties.style;
let style = layer.data[j].properties.style;
if (style == undefined || style == null){
style = {"color": "#FF6296"};
}
const pathData = layer.data[j];
if(layer.hoverable&&path.contains(img_point.x,img_point.y)){
this.resize();
Expand Down Expand Up @@ -907,4 +910,4 @@



})(OpenSeadragon)
})(OpenSeadragon)

0 comments on commit e48dffb

Please sign in to comment.