Ticket #729: arced.patch
File arced.patch, 5.7 KB (added by westram, 8 years ago) |
---|
-
WINDOW/AW_print.cxx
261 261 bool AW_device_print::arc_impl(int gc, AW::FillStyle filled, const AW::Position& center, const AW::Vector& radius, int start_degrees, int arc_degrees, AW_bitset filteri) { 262 262 bool drawflag = false; 263 263 if (filteri && filter) { 264 aw_assert(radius.x()>0 && radius.y()>0); 264 // aw_assert(radius.x() != 0 && radius.y() != 0); 265 266 if (nearlyZero(radius.x())) return false; // @@@ hack: skip (should print a line) 267 if (nearlyZero(radius.y())) return false; // @@@ hack: skip (should print a line) 268 265 269 Rectangle Box(center-radius, center+radius); 266 270 Rectangle screen_box = transform(Box); 271 267 272 Rectangle clipped_box; 268 drawflag = box_clip(screen_box, clipped_box); 273 drawflag = box_clip(screen_box, clipped_box); 274 269 275 bool half_visible = (clipped_box.surface()*2) > screen_box.surface(); 270 271 276 drawflag = drawflag && half_visible; 272 277 // @@@ correct behavior would be to draw an arc if only partly visible 273 278 -
SL/TREEDISP/TreeDisplay.cxx
2542 2542 remarkPos.movey(scaled_remark_ascend*(right ? 1.2 : -0.1)); // lower subtree -> draw below branch; upper subtree -> draw above branch 2543 2543 const AW_pos alignment = 1; // =right-justified 2544 2544 2545 // @@@ circle and remark positions are wrong for BS_ARCHED! 2546 2545 2547 bool bootstrap_shown = TREE_show_branch_remark(disp_device, son->get_remark(), son->is_leaf, remarkPos, alignment, remark_text_filter, bootstrap_min); 2546 2548 if (show_circle && bootstrap_shown) { 2547 2549 show_bootstrap_circle(disp_device, son->get_remark(), circle_zoom_factor, circle_max_size, len, circlePos, use_ellipse, scaled_branch_distance, bs_circle_filter); … … 2551 2553 set_line_attributes_for(son); 2552 2554 unsigned int gc = son->gr.gc; 2553 2555 2554 if (branch_style == BS_RECTANGULAR) { 2555 draw_branch_line(gc, s, n, line_filter); 2556 draw_branch_line(gc, attach, s, vert_line_filter); 2556 switch (branch_style) { 2557 case BS_RECTANGULAR: 2558 draw_branch_line(gc, s, n, line_filter); 2559 draw_branch_line(gc, attach, s, vert_line_filter); 2560 break; 2561 2562 case BS_DIAGONAL: 2563 draw_branch_line(gc, attach, n, line_filter); 2564 break; 2565 2566 case BS_ARCHED: { 2567 Position center = attach+(n-s); 2568 disp_device->arc(gc, FillStyle::EMPTY, center, s-center, right ? 90 : 180, 90, line_filter); 2569 break; 2570 } 2557 2571 } 2558 else {2559 td_assert(branch_style == BS_DIAGONAL);2560 draw_branch_line(gc, attach, n, line_filter);2561 }2562 2572 } 2563 2573 if (at->name) { 2564 2574 diamond(at->gr.gc, attach, NT_DIAMOND_RADIUS); … … 3580 3590 3581 3591 aws->label("Branch style"); 3582 3592 aws->create_option_menu(AWAR_DTREE_BRANCH_STYLE, true); 3583 aws->insert_default_option("Rectangular", "R", BS_RECTANGULAR); 3584 aws->insert_option ("Diagonal", "D", BS_DIAGONAL); 3593 aws->insert_default_option("Rectangular", "R", BS_RECTANGULAR); 3594 aws->insert_option ("Diagonal", "D", BS_DIAGONAL); 3595 aws->insert_option ("Arched", "A", BS_ARCHED); 3585 3596 aws->update_option_menu(); 3586 3597 aws->at_newline(); 3587 3598 … … 4010 4021 const AttachSettings& SETT = attach_settings[attach_style]; 4011 4022 char *spool_name2 = GBS_global_string_copy("%s%s", spool_name, SETT.suffix); 4012 4023 4013 for (BranchStyle bstyle = BS_RECTANGULAR; bstyle<=BS_ DIAGONAL; bstyle = BranchStyle(bstyle+1)) {4024 for (BranchStyle bstyle = BS_RECTANGULAR; bstyle<=BS_ARCHED; bstyle = BranchStyle(bstyle+1)) { 4014 4025 if (bstyle != BS_RECTANGULAR) { // test alternate branch-styles only .. 4015 4026 if (istyle != AP_TREE_NORMAL) continue; // .. for dendrogram view 4016 4027 if (attach_style != 0 && attach_style != 3) continue; // .. for traditional and centered attach_points … … 4019 4030 static const char *suffix[] = { 4020 4031 "", 4021 4032 "_diagonal", 4033 "_arched", 4022 4034 }; 4023 4035 4024 4036 char *spool_name3 = GBS_global_string_copy("%s%s", spool_name2, suffix[bstyle]); 4025 4037 4026 //#define TEST_AUTO_UPDATE // dont test, instead update expected results4038 #define TEST_AUTO_UPDATE // dont test, instead update expected results 4027 4039 { 4028 4040 char *spool_file = GBS_global_string_copy("%s_curr.fig", spool_name3); 4029 4041 char *spool_expected = GBS_global_string_copy("%s.fig", spool_name3); -
SL/TREEDISP/TreeDisplay.hxx
255 255 enum BranchStyle { 256 256 BS_RECTANGULAR, // traditional rectangular branches 257 257 BS_DIAGONAL, // diagonal branches (directly from fathers to sons attach point) 258 BS_ARCHED, // using arcs (located between BS_RECTANGULAR and BS_DIAGONAL) 258 259 }; 259 260 260 261 enum GroupStyle {